|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-06-18 15:25 UTC] cardinal@php.net
[2004-07-20 19:07 UTC] jmroth at iip dot lu
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 11:00:02 2025 UTC |
Let's say I have this string: /FAQ/ (a URI, actually) An explode action (delim is /)with a resulting count of the array reveals 3 elements. After an array_shift or array_pop, the count goes to 1. 3-1=1? $uri = strtolower(preg_replace("/[^a-zA-Z0-9\/]/","",$HTTP_SERVER_VARS["REQUEST_URI"])); $uri = explode("/", $uri); // make it an array echo count($uri); $uri = array_shift($uri); // delete first value which is always empty echo count($uri);