【问题标题】:PHP remove certain group of characters from string [duplicate]PHP从字符串中删除某些字符组[重复]
【发布时间】:2013-01-05 03:20:16
【问题描述】:

可能重复:
PHP Get File Name Without File Extension

使用 php,我如何从字符串中删除特定的字符集。例如我想从:

http://www.domain.com/folder/image.gif

image

我想删除除图像名称之外的所有内容。

【问题讨论】:

标签: php


【解决方案1】:

所以你只想要文件名?使用pathinfo()

$name = pathinfo('http://www.domain.com/folder/image.gif', PATHINFO_FILENAME);

【讨论】:

  • 你能详细说明反对意见吗?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2016-03-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-12-21
  • 2018-11-03
  • 1970-01-01
相关资源
最近更新 更多