- chr: documentation ( source)
<?php
$img = imagecreatefromjpeg('http://logicnet.dk/Analyzer/help/Lenna.jpg');
$msg = '';
$msgchar = 0;
for($i=0;$i<8;$i+=8)
{
$msgchar = (($msgchar << 1) | (1 & imagecolorat($img, $i , 0)));
if(($i+8) % 64 == 0)
{
$msg .= chr($msgchar);
$msgchar = 0;
}
}
echo $msg;