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('moron123') . '---' . dechex('moron123');

preferences:
43.44 ms | 402 KiB | 5 Q