search
Homephp教程php手册php获取文件名后缀常用方法小结

这篇文章主要介绍了php获取文件名后缀常用方法,实例分析了五种常用的php获取文件名后缀的技巧,具有一定参考借鉴价值,需要的朋友可以参考下

本文实例汇总了php获取文件名后缀常用方法。分享给大家供大家参考。具体实现方法如下:

"; //第二种方法 echo end($pics)."
"; //end()方法,,获取数组最后一个单元值 //第三种方法 $info = pathinfo($pic); echo $info['extension']."
"; //第四种方法 echo pathinfo($pic,PATHINFO_EXTENSION)."
"; //第五种方法 $offset = strrpos($pic,'.'); //计算指定字符串在目标字符串中最后一次出现的位置 echo substr($pic,$offset+1); ?>

希望本文所述对大家的php程序设计有所帮助。

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment