note 55065 deleted from function.explode by colder
| From: | colder@php.net | Date: | Tue, 21 Nov 2006 09:31:21 +0000 |
| Subject: | note 55065 deleted from function.explode by colder | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-119925@lists.php.net to get a copy of this message | ||
Note Submitter: x403 at yandex dot ru
----
For parsing URL better use Preg_split with flag PREG_SPLIT_NO_EMPTY because Explode or Split
functions set empty array elements. For example:
$parts = preg_split("/\//i", $_SERVER["REQUEST_URI"], -1, PREG_SPLIT_NO_EMPTY);
result: Array ( [0] => mix [1] => exhibit )
Explode("/",$_SERVER["REQUEST_URI"] )
result: Array ( [0] => [1] => [2] => mix [3] => exhibit )