Home >Backend Development >PHP Tutorial >php 中把一个array(255,11,22,2,0.)转换成图片输出,该如何解决

php 中把一个array(255,11,22,2,0.)转换成图片输出,该如何解决

WBOY
WBOYOriginal
2016-06-13 12:02:471027browse

php 中把一个array(255,11,22,2,0...)转换成图片输出
从第三方的接口中获取得到一个图片的二进制数组类似如下结果:

<br />$img_data = array(255,11,2,0,112,4,...);<br />

请教大家怎么把上述的数组转换为图片输出?
------解决方案--------------------
这个数据不正常吧
------解决方案--------------------
如果这的数图片数据的话,则
echo join('', array_map('chr', $img_data));

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn