Php to obtain the file suffix in multiple ways, phpexplode function, function usage reference ?? The code is as follows: Copy the code $ pic = 'ABC. php '; $ pics = explode ('. ', $ pic); echo $ num = count ($ pics); echo' & lt; multiple methods for getting the file suffix in br php
I. php explode function. for function usage reference ?? The code is as follows:
$ Pic = 'ABC. php ';
$ Pics = explode ('.', $ pic );
Echo $ num = count ($ pics );
Echo'
'. $ Pics [$ num-1];
?
In this way, you can output
. Php.
The following uses foreach? Usage of this function ?? The code is as follows:
Foreach ($ pics as $ value) // 2
{
? $ A = $ value;
}
Echo $ .'
';
?
Is there a better function end? I recommend using this function to quickly end the function usage ?? The code is as follows:
Echo end ($ pics );
Echo'
';
?
Other access methods can be determined during File upload. However, we cannot use $ _ FILES for file upload without uploading.
For more details, see: http://www.111cn.net/phper/php/42034.htm