Home > Backend Development > PHP Tutorial > 字符串获取操作

字符串获取操作

WBOY
Release: 2016-06-23 14:01:35
Original
986 people have browsed it

大家好:
  想请教一下
   现在有这样的一段输出
   "www.baidu.com/index.html"
   通过什么办法可以获取html的文件名index?
   希望输出的结果是

   index
以上,谢谢


回复讨论(解决方案)

$str =  "www.baidu.com/index.html";	$info = pathinfo($str);	var_dump($info['filename']);
Copy after login
Copy after login

$str =  "www.baidu.com/index.html";	$info = pathinfo($str);	var_dump($info['filename']);
Copy after login
Copy after login
OK。谢谢

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template