URL Parsing Help
| From: | Shane Lambert | Date: | Tue, 29 Jan 2002 22:33:48 +0000 |
| Subject: | URL Parsing Help | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-82618@lists.php.net to get a copy of this message | ||
I am trying to write software that will allow me to pass variables to a php script like:
index.php/option=contact/step=view
When I do this, I get the varibal PATH_INFO which contains "/option=contact/step=view". Now, what I want is to have the following:
$option = "contact"
$step = "view"
I tried using '$array = explode("/",$PATH_INFO);' which gives me the array:
$array[1] = "option=contact"
$array[2] = "step=view"
This of course is not what I want. I want:
$array[option] = "contact"
$array[step] = "view"
So that when I use the extract($array) command I get the variables:
$option = "contact"
$step = "view"
Like I want. If you aren't lost and you know the answer, PLEASE HELP!