/ Published in: PHP
Useful for comparing file path when developing on different test sites, leaves just file name, also strips named anchors from end
Expand |
Embed | Plain Text
// REPLACE FOLDERS WITH NOTHING // str_replace(find_this, replace_with_this, string_to_search ); // This strips folder names from the path //$me = ereg_replace ( find_this, replace_with_this, string_to_search ); // This strips #anything from end of url
Comments
Subscribe to comments
You need to login to post a comment.

Be carefull when PHP6 hits, because then this won't work anymore.
The "ereg" regular expression library will be removed from the main build and turned into an extension. The "preg" regex library is recommended.