No need to use string functions. You can use something that's actually designed for what you want: pathinfo():
pathinfo()
$path = $_FILES['image']['name']; $ext = pathinfo($path, PATHINFO_EXTENSION);
1.4m articles
1.4m replys
5 comments
57.0k users