http://www.domain.com/script/file.php
I want to print just :
http://www.domain.com/script/
but file.php isnt going to stay the same length everytime & neither is the rest of the URL, so what I need to do is strip everything from the right of the first forwardslash on the right...
Thanks for any help
-Arron
Resolved :
<?php
$mystring = 'http://www.domain.com/script/file.php';
$findme = '/';
$pos = strrpos($mystring, $findme);
$substr = substr("$mystring", 0, $pos);
echo $substr;
?>