Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
January 8, 2008, 1:07 pm
rate this thread
Im trying to write a regular expression in PHP to check if a submitted
filename has .php on the end of it. For example, filename.html woulod
return false whereas filename.php would return true.
My code is:
if (ereg ("$.php", $filename))
Obviously my expression is wrong, could someone please tell me what Im
doing wrong. Thanks
Re: Using a simple regular expressions to check a filename has '.php' on the end of it
A regex is overkill for a simple string. strcmp() is better in this case.
Remove the "x" from my email address
JDS Computer Training Corp.
- The Natural Philosopher
January 8, 2008, 1:41 pm