fork download
  1. <?php
  2.  
  3. $string = 'something %2A something %3C something';
  4. $string = preg_replace_callback('~%([A-Z0-9]{2})~', function ($m) {return chr(hexdec($m[1]));}, $string);
  5.  
  6. print $string;
Success #stdin #stdout 0.01s 24596KB
stdin
Standard input is empty
stdout
something * something < something