while a bit ugly, you could just use array_pop() to get each item into a
variable and then echo them back out into your variable assignment...
somewhat cleaner would be to create an assoc array of config vars:
$uri_items_num=count($path_array);
for ($i=1, $i <= $uri_items_num, $i++)
{
$key=array_pop($path_array);
$value=array_pop($path_array);
config_array[$key] = $value
}
or something.
regards,
jaxon
On 3/25/01 6:54 PM, "Chris Cocuzzo" <[EMAIL PROTECTED]> wrote:
> right. ok I understand that explode function. But what I'm asking is not so
> much once I have a URL in the form of /something/something/something
> ...etc.., but more if I have a URL like /something?d=a&f=g, to make it like
> /something/d/a/f/g ... do you know what I mean?
>
>
> Chris
>
> -----Original Message-----
> From: Jaxon [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, March 25, 2001 6:32 PM
> To: [EMAIL PROTECTED]; PHP General List (E-mail)
> Subject: Re: [PHP] A few questions...
>
>
> Chris,
>
>> I think I just slightly unsure of how that explode() function works in
> this
>> situation...could you clarify further?
>>
>>>
>>> $path_array = explode('/', $REQUEST_URI);
>>>
>>> $last_item = array_pop($path_array);
>>> $next_to_last_item = array_pop($path_array); / item
>>>
> $REQUEST_URI contains the non-domin path (the URI) - it's a predefined
> variable like $PHP_SELF, etc
>
> http://www.php.net/manual/en/language.variables.predefined.php
>
> in this explode() example, the '/' is the devider, so if you have
>
> http://www.somedomain.com/dir1/dir2/dir3/somepage3.php
>
> The URI is: /dir1/dir2/dir3/somepage3.php
>
> and 'exploding' divides that into array elements (dir1, dir2, dir3,
> somepage.php)
>
> regards,
> jaxon
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]