php explode file extension name giving null -


so, when upload files, want check file extension is:

$files      = $_files['files']; 

enter image description here

$files_name      =  $files['name'];      

shows: `"img.jpg"'

$files_name_explode = end(explode('.', $files_name)); 

getting null.

what doing wrong?

thanks

use below code :

$path = $_files['files']['name']; $ext = pathinfo($path, pathinfo_extension); 

hope :)


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -