I want to convert normal text to \\x codes for e.g \\x14\\x65\\x60
For example :
normal text = \"base64_decode\" converted \\x codes for above text =
Here's working code:
function make_hexcodes($text) { $retval = ''; for($i = 0; $i < strlen($text); ++$i) { $retval .= '\x'.dechex(ord($text[$i])); } return $retval; } echo make_hexcodes('base64_decode');
See it in action.