note 20851 deleted from function.pathinfo by vincent
| From: | vincent@php.net | Date: | Sat, 16 Aug 2003 15:12:51 +0000 |
| Subject: | note 20851 deleted from function.pathinfo by vincent | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-54382@lists.php.net to get a copy of this message | ||
Note Submitter: kelson@pobox.com
----
An optimized version of this function (no loops, no temporary variables) would be:
function doc_root($path) {
return str_repeat('../', substr_count($path, "/")-1);
}
Then call it the same way.