且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在PHP中找到路径中图像的扩展名?

更新时间:2023-12-02 09:59:22

$ext = pathinfo('/testdir/dir2/image.gif', PATHINFO_EXTENSION); //$ext will be gif

更新:我看到很多downvotes。我的方法有什么问题?请告诉我。

UPDATE: I see a lot of downvotes. What's the problem with my approach? Please let me know.