Return to Snippet

Revision: 68703
at February 13, 2015 11:32 by flatearthcomms

Initial Code
$name = preg_replace('/[^a-z0-9.]+/', '_', strtolower($filename));

Initial URL

Initial Description
Translate non alphanumeric characters into an underscore. Doesn't create double underscores if there's two spaces in a row. Also turns name to lowercase. Use with trim to avoid spaces at front or end.

Initial Title
translate non alphanumeric characters from file name into underscores

Initial Tags
form, php, web

Initial Language