here is a nice simple function that uses preg_replace to clean a string, and make sure it returns only normal characters.
It is another way of cleaning a string, similar to the method i used in Generate Safe File Name in PHP using ereg_replace function.
Not sure really which is better i think one of them may be faster than the other. Please feel free to comment and let me know.
return only normal characters (a-z 0-9) php function using preg_replace
Wednesday, June 22, 2011
Subscribe to:
Posts (Atom)