Htaccess    html   Php    javascript   Asp   css    maths  Past Questions  Practice Tests Online

pathinfo function syntax tag tutorial 2013





Alert! Connect with 10,000 Chating Online. Join Now

Php pathinfo () function

Write your php code

 
<?php ?>

Php Result


Your code below



(PHP 4 >= 4.0.3, PHP 5)

pathinfo -- Returns information about a file path

Syntax

array pathinfo ( string path [, int options] )

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

You can specify which elements are returned with optional parameter options. It composes from PATHINFO_DIRNAME, PATHINFO_BASENAME and PATHINFO_EXTENSION. It defaults to return all elements.

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().

Php pathinfo Function syntax tag

pathinfo php code on this is provided for your study purpose, it will guide you to know how create and design a website using php. use it to practice and train your self online



Php pathinfo syntax tutorial

php tutorial guide and code design are for easy learning and programming. The code practice section provided at the top is for practising of this syntax. Use the code section up to practice your php programming online. Learning php is very easy, all you need is to use the examples on this site and practice them to perfect your skills.


Function index

Variables

Expressions

Operators

Control-Structures

Cookies

Array

Date & Time

Directory function

File

Image

Operators

Form data handling

Mathematics operators

Mail

Php Mysql

Network Functions

Strings

php tutorial guides,functions, classes, code examples and tags for creating simple dynamic site to mysql database driven sites
 
 
Htaccess    html   Php    javascript   Asp   css    maths  Past Questions  Practice Tests Online