A friend of mine updated your regular expression... Check it out if your
interested.
Jeremy
Dear Jeremy,
Thanks for writing!
I saw this regular expression and thought you might like it... :)
preg_replace(/^\/?(.*)\/[\w]+\.php$/,$1,$PHP_SELF)
that strips that leading forward slash
] The-Spectrum Network CEO ABN: 64 235 749 494
[EMAIL PROTECTED]
www.the-spectrum.org --oOo---oOo--
- Original Message -
From: Jeremy Peterson [EMAIL PROTECTED]
To: php-db@lists.php.net
Sent: Friday, January 20, 2006 8:09 AM
Subject: Re: [PHP-DB] How can I solve
Hi everyone,
I am using PHP_SELF in order to get the current path on a dynamically
created webpage. This gives me the following:
/my_website/index.php
My problem is, ALL I NEED is the directory name - no / or no index.php, how
can I strip these out to leave JUST the folder name the
try
$x =pathinfo($_SERVER['PHP_SELF']);
echo $x['dirname'];
=C=
|
| Cal Evans
| http://blog.calevans.com
|
|
Chris Payne wrote:
Hi everyone,
I am using PHP_SELF in order to get the current path on a dynamically
created webpage. This gives me the following:
/my_website/index.php
Wonderful thank you, it displays a single / before the dir name but I can
remove that without too much trouble :-)
Thank you.
Chris
try
$x =pathinfo($_SERVER['PHP_SELF']);
echo $x['dirname'];
=C=
|
| Cal Evans
| http://blog.calevans.com
|
|
Chris Payne wrote:
Hi everyone,
I am using
;-)
by love of my life I mean, Regular Expressions, not that particular one
:P
ciao
- Original Message -
From: Chris Payne [EMAIL PROTECTED]
To: php-db@lists.php.net
Sent: Thursday, January 19, 2006 3:58 AM
Subject: RE: [PHP-DB] How can I solve this?
Wonderful thank you, it displays