Board index   FAQ   Search  
Register  Login
Board index PHP Your Scripts

Help to pack random hex

This is where you share YOUR scripts with others

Moderators: macek, egami, gesf

Help to pack random hex

Postby tesmanuk » Mon Jan 23, 2012 3:58 am

Code: Select all
<?php
$text ="world";
$str="hello ".str_replace("/","&",$text);
$hex1=bin2hex($str);
function random($match) {return $match[1].rand(0,9);}
$hex2=preg_replace_callback("/([a-zA-Z0-9]{2})/",'random',$hex1);
echo $hex2;
?>

i need help to pack from $hex2 to get original text "hello world" please help me :help: :help:
tesmanuk
New php-forum User
New php-forum User
 
Posts: 1
Joined: Mon Jan 23, 2012 3:09 am

Return to Your Scripts

Who is online

Users browsing this forum: No registered users and 0 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.