亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

PHP pathinfo() 函數(shù)

定義和用法

pathinfo() 函數(shù)以數(shù)組的形式返回文件路徑的信息。

語法

pathinfo(path,options)
參數(shù) 描述
path 必需。規(guī)定要檢查的路徑。
process_sections

可選。規(guī)定要返回的數(shù)組元素。默認(rèn)是 all。

可能的值:

  • PATHINFO_DIRNAME - 只返回 dirname
  • PATHINFO_BASENAME - 只返回 basename
  • PATHINFO_EXTENSION - 只返回 extension

說明

pathinfo() 返回一個(gè)關(guān)聯(lián)數(shù)組包含有 path 的信息。

包括以下的數(shù)組元素:

  • [dirname]
  • [basename]
  • [extension]

提示和注釋

注釋:如果不是要求取得所有單元,則 pathinfo() 函數(shù)返回字符串。

例子

例子 1

<?php
print_r(pathinfo("/testweb/test.txt"));
?>

輸出:

Array
(
[dirname] => /testweb
[basename] => test.txt
[extension] => txt
)

例子 2

<?php
print_r(pathinfo("/testweb/test.txt",PATHINFO_BASENAME));
?>

輸出:

test.txt