Date Added: 14/01/2015

realpath — Returns canonicalized absolute pathname __DIR__


echo realpath(__FILE__);

output: /home/develop1/public_html/ContactForm.php parse_str parse_url    

print(__FILE__);
echo '<br>';

echo'PATHINFO_DIRNAME: '. pathinfo(__FILE__, PATHINFO_DIRNAME); echo '<br>';
echo'PATHINFO_BASENAME: '. pathinfo(__FILE__, PATHINFO_BASENAME); echo '<br>';
echo'PATHINFO_EXTENSION: '. pathinfo(__FILE__, PATHINFO_EXTENSION); echo '<br>';

&nbsp;

Output:

/home/develop1/public_html/folder/example.php
PATHINFO_DIRNAME: /home/develop1/public_html/folder
PATHINFO_BASENAME: example.php
PATHINFO_EXTENSION: php

Last Update: Posted by: müslüm ÇEN
Not Commented Yet !
Please login in order to comment . Login