输出时,十六进制值会附加到字符串

时间:2014-01-24 15:46:33

标签: php hex mjpeg

# Per-image header, note the two new-lines

print "--$boundary\n";


$file= str_replace("/snapshots", "", $_GET['src'].'?random='.rand(1, 1000));
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $file);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
$out = curl_exec($ch);
curl_close($ch);


print "Content-type: image/jpeg\r\n";
print("Content-Length: ". strlen($out) ."\r\n\r\n");

print($out."\r\n");
# Your function to get one jpeg image
usleep(500000);
}

这就是回应:

b
--my_mjpeg

1a
Content-type: image/jpeg

19
Content-Length: 11808


169a
......JFIF.............C..............................................!........."$".$.......C.........................................................................@.

0 个答案:

没有答案