3v4l.org

run code in 300+ PHP versions simultaneously
<?php function strToHex($string) { $hex=''; for ($i=0; $i < strlen($string); $i++) { $hex .= dechex(ord($string[$i])); } return $hex; } echo strToHex('moron1234567890'); echo '----'; echo bin2hex('moron1234567890');

preferences:
43.54 ms | 402 KiB | 5 Q