Quantcast
Channel: Developer Feed - Snippet
Viewing all articles
Browse latest Browse all 178

How to get file extension in PHP?

$
0
0
  1.         /* Extract the file extension
  2.          *
  3.          * @access      public
  4.          * @param       string
  5.          * @return      string
  6.          */   
  7.         function get_extension($filename)
  8.         {
  9.                 $x=explode('.',$filename);
  10.                 return'.'.end($x);
  11.         }     

Viewing all articles
Browse latest Browse all 178

Trending Articles