... what, the off by one error?
Hey, I was just providing suggestion off the top of my head. :-P
-Minuk
Robert Cummings wrote:
On Thu, 2005-10-20 at 23:27, Minuk Choi wrote:
Off the top of my head...
$filename = $_SERVER['PHP_SELF'];
$strippedFilename = substr($filename,
On Fri, 2005-10-21 at 19:58, Minuk Choi wrote:
... what, the off by one error?
Hey, I was just providing suggestion off the top of my head. :-P
Oh I know, I was just pointing out that it won't work :) Doesn't work
because it only strips off the first path segment (assuming no off by
one error
On Fri, 2005-10-21 at 21:01 -0400, Robert Cummings wrote:
Oh I know, I was just pointing out that it won't work :) Doesn't work
because it only strips off the first path segment (assuming no off by
one error also ;). For instance:
/a/b/c/d/foo.php
becomes:
a/b/c/d/foo.php
On Sat, 2005-10-22 at 10:02, Jasper Bryant-Greene wrote:
On Fri, 2005-10-21 at 21:01 -0400, Robert Cummings wrote:
Oh I know, I was just pointing out that it won't work :) Doesn't work
because it only strips off the first path segment (assuming no off by
one error also ;). For instance:
SCRIPT_NAME and PHP_SELF always include leading url information and
slashes. Is there a function I can use to skin either down to the
filename? No slashes or leading url.
John
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Thu, 2005-10-20 at 22:22 -0400, John Taylor-Johnston wrote:
SCRIPT_NAME and PHP_SELF always include leading url information and
slashes. Is there a function I can use to skin either down to the
filename? No slashes or leading url.
http://php.net/basename for filesystem paths
On Thu, 2005-10-20 at 22:22, John Taylor-Johnston wrote:
SCRIPT_NAME and PHP_SELF always include leading url information and
slashes. Is there a function I can use to skin either down to the
filename? No slashes or leading url.
echo ereg_replace( '^.*/', '', $_SERVER['SCRIPT_NAME'] )
ereg
Off the top of my head...
$filename = $_SERVER['PHP_SELF'];
$strippedFilename = substr($filename, strrpos($filename, '/'));
references :
http://us3.php.net/substr
http://us3.php.net/manual/en/function.strrpos.php
-Minuk
John Taylor-Johnston wrote:
SCRIPT_NAME and PHP_SELF always include
On Thu, 2005-10-20 at 23:27, Minuk Choi wrote:
Off the top of my head...
$filename = $_SERVER['PHP_SELF'];
$strippedFilename = substr($filename, strrpos($filename, '/'));
Won't work, I'll leave the reason as an exercise :B
Cheers,
Rob.
--
9 matches
Mail list logo