Hello
First, Happy Easter.
I can't solve my small problem with a path.
<?php
echo $_SERVER['PHP_SELF'];
echo '<br />';
echo $a = dirname($_SERVER['PHP_SELF']);
echo '<br />';
echo rtrim($a,'imagesw');
?>
the result is:
/cw/draw/upload2/images/test.php
/cw/draw/upload2/images
/cw/draw/upload2/
My purpose is it obtain the third line '/cw/draw/upload2/' but not by trim function. I want to cut off the last directory. In the case above it's 'images', but what if it's not and it's sth else... How can I automate the script to get the last line i.e. '/cw/draw/upload2/'.
Thanks in advance and once again Happy Easter.