Home  >  Article  >  Backend Development  >  字符串获取操作

字符串获取操作

WBOY
WBOYOriginal
2016-06-23 14:01:35953browse

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

   index
以上,谢谢


回复讨论(解决方案)

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

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

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