Revision: 1445
Updated Code
at October 9, 2006 11:11 by sorehead
Updated Code
<?php /* Convert string to underscore_name Converts "My House" to "my_house". Converts " Peter's nice car " to "peters_nice_car". Converts "_88" to "88" */ 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; } ?>
Revision: 1444
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at October 9, 2006 11:04 by sorehead
Initial Code
<?php /* Convert string to underscore_name Converts "My House" to "my_house". Converts " Peter's nice car " to "peters_nice_car". Converts "_88" to "88" */ 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; } ?>
Initial URL
Initial Description
Initial Title
Convert string to underscore_name
Initial Tags
Initial Language
PHP