[EMAIL PROTECTED] wrote:
Hi,
How can I get multiple values from a variable (from URL) and parse them into an
array?
For example:
example.php?graphArray=20,35,84,21,23,22,24,95
parse_str is for multiple variables, not multiple values of one variable.
$x_array = explode(',', $_GET['graphArray'
Hi,
How can I get multiple values from a variable (from URL) and parse them into an
array?
For example:
example.php?graphArray=20,35,84,21,23,22,24,95
parse_str is for multiple variables, not multiple values of one variable.
PLEASE HELP!!!
Thank you
Aret
--
This message was sent on behal
On Thu, 16 Sep 2004 16:25:31 -0500, Greg Donald <[EMAIL PROTECTED]> wrote:
> On Thu, 16 Sep 2004 13:31:08 -0700, Andrew Kreps <[EMAIL PROTECTED]> wrote:
> > PHP can be run from the command line, in which case the GET and POST
> > arrays wouldn't exist.
>
> $_GET and $_POST exist in CLI php, they a
On Thu, 16 Sep 2004 13:31:08 -0700, Andrew Kreps <[EMAIL PROTECTED]> wrote:
> PHP can be run from the command line, in which case the GET and POST
> arrays wouldn't exist.
$_GET and $_POST exist in CLI php, they are just empty initially:
#!/usr/bin/php
Array
(
)
Array
(
)
Array
(
[x] => 1
)
From: "Gryffyn, Trevor" <[EMAIL PROTECTED]>
Regardless of how this script is called, is there, or is there not a
function that will take that string and pull the values after the "?"
and toss them into an associative array?
Yes, parse_url() to get the query string and then parse_str() to put it int
eptember 16, 2004 4:31 PM
> To: PHP
> Subject: Re: [PHP] checking multiple URL parameters
>
>
> On Thu, 16 Sep 2004 12:47:26 -0700 (PDT), Chris Shiflett
> <[EMAIL PROTECTED]> wrote:
> >
> > This makes absolutely no sense to me. What do you mean by
> submi
From: "Andrew Kreps" <[EMAIL PROTECTED]>
Also, imagine if you had a database of URL's that you wanted to
dissect for it's component information?
That being said, I'm not aware of a PHP function that performs this
operation for you.
parse_url() and parse_str()
---John Holmes...
--
PHP General Maili
> This makes absolutely no sense to me. What do you mean by
> submitted? How
> would a PHP script be executed at all if the browser never sends a
> request?
Hah.. I should just let this all go, go home, get some sleep, and start
confusing people again tomorrow, but I want to clarify a little bit.
On Thu, 16 Sep 2004 12:47:26 -0700 (PDT), Chris Shiflett
<[EMAIL PROTECTED]> wrote:
>
> This makes absolutely no sense to me. What do you mean by submitted? How
> would a PHP script be executed at all if the browser never sends a
> request?
>
PHP can be run from the command line, in which case t
--- "Gryffyn, Trevor" <[EMAIL PROTECTED]> wrote:
> You're right though, $_GET and $_POST and such are already an
> associative array. I actually think I was thinking of a function
> that parsed a URL itself, regardless of whether it was submitted
> or not.
This makes absolutely no sense to me. Wha
ET
data, right?
I know you could write a short script that would do it, but I think I
saw a built-in function that did it as well.
-TG
> -Original Message-
> From: Chris Shiflett [mailto:[EMAIL PROTECTED]
> Sent: Thursday, September 16, 2004 2:19 PM
> To: Andre
--- Andrew Kreps <[EMAIL PROTECTED]> wrote:
> --- Trevor Gryffyn <[EMAIL PROTECTED]> wrote:
> > I could have sworn that there was a function that dropped ALL
> > GET values into an associative array. Kind of the inverse of
> > "http_build_query".
>
> I believe you're thinking of import_request_var
t; From: Andrew Kreps [mailto:[EMAIL PROTECTED]
> Sent: Thursday, September 16, 2004 1:55 PM
> To: PHP
> Subject: Re: [PHP] checking multiple URL parameters
>
>
> On Thu, 16 Sep 2004 11:15:13 -0400, Gryffyn, Trevor
> <[EMAIL PROTECTED]> wrote:
> > I could have sworn th
On Thu, 16 Sep 2004 11:15:13 -0400, Gryffyn, Trevor
<[EMAIL PROTECTED]> wrote:
> I could have sworn that there was a function that dropped ALL GET values
> into an associative array. Kind of the inverse of "http_build_query".
>
I believe you're thinking of import_request_variables ().
http://us2.
I could have sworn that there was a function that dropped ALL GET values
into an associative array. Kind of the inverse of "http_build_query".
At any rate, you can keep doing (isset($_REQUEST['mov']) AND
isset($_REQUEST['year'])) and such. Is that your question? How do you
do AND and OR operatio
same way, if i understand your questoin...
if your url looks like this
sometestpage.php?mov=something&year=1999
- the queries are seperated by the '&' char..
then
$_REQUEST will have both mov and year elements in it
so just as $_REQUEST['mov'] worked, so would $_REQUEST['year']
Jason
Dusti
16 matches
Mail list logo