2016年1月17日 星期日

How to get the file extension in PHP?


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

沒有留言:

wibiya widget