php-doc-en/reference/filesystem/functions/pathinfo.xml
2002-10-18 00:39:18 +00:00

86 lines
2.2 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.61 -->
<refentry id="function.pathinfo">
<refnamediv>
<refname>pathinfo</refname>
<refpurpose>Returns information about a file path</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>array</type><methodname>pathinfo</methodname>
<methodparam><type>string</type><parameter>path</parameter></methodparam>
</methodsynopsis>
<para>
<function>pathinfo</function> returns an associative array
containing information about <parameter>path</parameter>. The
following array elements are returned:
<parameter>dirname</parameter>, <parameter>basename</parameter>
and <parameter>extension</parameter>.
</para>
<para>
<example>
<title><function>pathinfo</function> Example</title>
<programlisting role="php">
<![CDATA[
<?php
$path_parts = pathinfo("/www/htdocs/index.html");
echo $path_parts["dirname"] . "\n";
echo $path_parts["basename"] . "\n";
echo $path_parts["extension"] . "\n";
?>
]]>
</programlisting>
</example>
</para>
<para>
Would produce:
<informalexample>
<programlisting>
<![CDATA[
/www/htdocs
index.html
html
]]>
</programlisting>
</informalexample>
</para>
<note>
<para>
For information on retrieving the current path info, read
the section on <link linkend="language.variables.predefined">
predefined reserved variables</link>.
</para>
</note>
<para>
See also <function>dirname</function>,
<function>basename</function>, <function>parse_url</function>
and <function>realpath</function>.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->