3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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 - 7.1.0
headerc47footer