By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,047 Members | 1,257 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,047 IT Pros & Developers. It's quick & easy.

Simple question: Stripping off part of a string

P: n/a
Hello

Its not that I want somebody to do work for me, I really read all about
preg_replace and other pregs and strs but cant actually do this one:
A specific example of code would be very appreciated.

$path = "/var/www/help/index.php";

the path can differ, there are more or less dirs but there always is
"/var/www" part and I want to strip it off and get whatever comes after
that.
I really cant understand these preg_replace parameters like
("/(<\/?)(\w+)([^>]*>)/e", So could anyone help me in the above specific
example ?


Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
str_replace("/var/www", "", $path)

-Steve
"lecichy" <co*****@vline.pl> wrote in message
news:bm**********@nemesis.news.tpi.pl...
Hello

Its not that I want somebody to do work for me, I really read all about
preg_replace and other pregs and strs but cant actually do this one:
A specific example of code would be very appreciated.

$path = "/var/www/help/index.php";

the path can differ, there are more or less dirs but there always is
"/var/www" part and I want to strip it off and get whatever comes after
that.
I really cant understand these preg_replace parameters like
("/(<\/?)(\w+)([^>]*>)/e", So could anyone help me in the above specific
example ?


Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.