3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "Header/Footer"; $special_char_find = array( "!","#","$","%","&","(",")","*","+", ",","-",".","/",":",";","<","=",">", "?","@","[","]","^","{","|","}","~" ); $special_char_replace = array( "c33","c35","c36","c37","c38","c40","c41","c42","c43", "c44","c45","c46","c47","c58","c59","c60","c61","c62", "c63","c64","c91","c93","c94","c123","c124","c125","c126" ); $str = str_replace($special_char_find, $special_char_replace, $str); $str = strtolower(preg_replace("/[^A-Za-z0-9_]/", '', str_replace(' ', '_', trim($str)))); $str = trim($str, "_"); echo $str;
Output for 4.3.0 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.17 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.7
headerc47footer

preferences:
245.22 ms | 406 KiB | 386 Q