Rate this script:  I Love it  /   I Hate it

Convert string to underscore_name


Code


function string_to_underscore_name($string)
{
    $string = preg_replace('/[\'"]/', '', $string);
    $string = preg_replace('/[^a-zA-Z0-9]+/', '_', $string);
    $string = trim($string, '_');
    $string = strtolower($string);
   
    return $string;
}
 

 

 
Convert string to underscore_name scripts | Convert string to underscore_name snippet | Convert string to underscore_name example | Convert string to underscore_name tutorial | Convert string to underscore_name code