Red Wingate wrote:
the magic constant __FILE__ will give you the absolut filesystem location of the file it is called. Eg:

/home/www/tests/foo.php ->
<?php
  echo __FILE__ ;
?>

will print: '/home/www/tests/foo.php';

to retrieve the path only you could do:
/home/www/tests/foo.php ->
<?php
  echo str_replace( basename ( __FILE__ ) , '' , __FILE__ );
?>

I think could be easier with dirname(__FILE__)

Regards,
Jordi.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to