Search DaTutorials:  
HOME
Php Tutorials
Articles
Basics
Date and Time
File Manipulations
Forms
Functions
General
Interactivity
MySql
Navigation
News,Shoutboxes and Blogs
Language Structure and Data Types
Searching
Security
String Manipulation
User Information and Stats
Search For a Tutorial
Php Reference

pathinfo

(PHP 4 >= 4.0.3, PHP 5)

pathinfo -- Returns information about a file path

Description

array pathinfo ( string path)

pathinfo() returns an associative array containing information about path. The following array elements are returned: dirname, basename and extension.

Example 1. pathinfo() Example

<?php

$path_parts
= pathinfo("/www/htdocs/index.html");

echo
$path_parts["dirname"] . "\n";
echo
$path_parts["basename"] . "\n";
echo
$path_parts["extension"] . "\n";

?>

Would produce:

/www/htdocs
index.html
html

Note: For information on retrieving the current path info, read the section on predefined reserved variables.

See also dirname(), basename(), parse_url() and realpath().



Copyright © 2001-2004 The PHP Group
All rights reserved.

     Mortgage Loans | Lajme Shqip | Loans | Buy Anything On eBay | Extranet
Home     Link To Us     Ad With Us     Contact Us     Tell A Friend     Affiliates     Blog     MsOfficeHelp