No need to use string functions. You can use something that's actually designed for what you want:
pathinfo()
:$path = $_FILES['image']['name'];
$ext = pathinfo($path, PATHINFO_EXTENSION);
reference : http://stackoverflow.com/questions/10368217/how-to-get-the-file-extension-in-php
沒有留言:
張貼留言