Jump to content

string to binary converter...


taith

Recommended Posts

thank ya kindly :P for those that have need of it...

<?
function exc($string){

$out=array();

for($i=0; $i<strlen($string); $i++) $out[]=$string{$i};

return $out;

}


function stb($s){
$s=exc($s);
foreach($s as $k=>$v) $s[$k]=str_pad(decbin(ord($v)), 8, "0", STR_PAD_LEFT);
return implode('',$s);
}

print_r(stb('test'));
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.