How to get the extention of the file with php with strrchr function
November 10th, 2007
Hi guys,
With this code you can get the extension of a file. This is very simple and useful.
-
$ext = strrchr($file,".");
If the value of $file is “/files/games/mathattach.swf” the value of $ext will be “.swf”;


Leave a Comment
Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
Trackback this post | Subscribe to the comments via RSS Feed