[wp-hackers] PHP one liner

Oliver Schwarz oliver.schwarz at gmail.com
Tue Dec 14 11:42:40 UTC 2004


Hi,

> Given $_SERVER['PHP_SELF'] == '/some/dir/index.php'
> 
> <?php $page = array_pop( explode( '/', $_SERVER['PHP_SELF'] ) ); ?>

nice code, could also be done with:

<?php $page = basename ($_SERVER['PHP_SELF']); ?>

Regards,

Olli

-- 
Oliver Schwarz
oliver.schwarz at gmail.com



More information about the hackers mailing list