Skip to main content


Following are the commonly php functions to get the path information of a file


realpath(string $path)
realpath — Returns canonicalized absolute pathname
Function realpath() expands all symbolic links and resolves references to '/./', '/../' and extra '/' characters in the input path and return the canonicalized absolute pathname.

Usage :
$realpath = realpath('./../../etc/passwd');


pathinfo() returns information about path: either an associative array or a string, depending on options.

Usage :
$path_parts = pathinfo('/www/htdocs/inc/');

the extension of the file will be in $path_parts['extension']

More info

dirname ( string $path )
dirname — Returns parent directory's path. Given a string containing the path of a file or directory, this function will return the parent directory's path.

$parent_dir= dirname("/etc/passwd");

More info

basename ( string $path [, string $suffix ] )
basename — Returns trailing name component of path. Given a string containing the path to a file or directory, this function will return the trailing name component. If the name component ends in suffix this will also be cut off.

echo( basename("/etc/sample.d", ".d") ); // returns sample
echo(basename("/etc/")); // returns etc
More info

PHP Filesystem Functions


Popular posts from this blog

How to apply for a new ration card and what are the documents required?

List of documents required for new ration card application in Kerala and how to apply

Application for a new ration card should be addressed to Taluk Supply Officer (TSO) / City Rationing Officer (CRO) of applicant's residing area.

Primary document required are Residence certificate, Income certificate and incase the applicant's name is in another ration card then he/she should submit the reduction certificate ontained from previous TSO / CRO as proof for removing his/her name from old Ration card.

You can get the new application from your currently residing Taluk Supply Office.

Payback Points - How to redeem - How to merge multiple payback accounts - Block Payback card - Payback customer care

Joomla and Forum Integration - Integrating Forums to Joomla

Joomla is one of the most popular CMS opensource packages. It is very easier to develop website's using Joomla. You just need to download Joomla package from Joomla's Official website  and install it on your domain and later adding customizations to templates and feature and Your website is ready :). Now a days most websites provides a forum section for it users for discussing various article topics, gathering opinions etc.

Following are some best know forum opensource packages which can be integrated with Joomla and create a new forum experience for users

Urgent Openings for PHP trainees, Andriod / IOS developers and PHP developers in Kochi Trivandrum Calicut and Bangalore. Please Send Your updated resumes to   Read more »
Search This Blog