Home > Archive > PHP DB > April 2004 > passing var array
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| Sukanto Kho 2004-04-27, 12:21 am |
| Hi,
How to pass var array to other page?
I use $_GET but when I echo it, it appear "array"...
Thanx
Sk2
| |
| Pete M 2004-04-27, 12:21 am |
| http://localhost/index.php?val_one=one&val2=2
on index.php
print_r($_GET) will show the array
echo "val l=".$_GET['val_one'];
echo "val 2=".$_GET['val2'];
its CAse senSitivE
you can also do a
foreach($_GET as $k => $v)
{
echo $k."=".$v;
}
Sukanto Kho wrote:
> Hi,
>
> How to pass var array to other page?
>
> I use $_GET but when I echo it, it appear "array"...
>
> Thanx
>
> Sk2
| |
| Andy Ladouceur 2004-04-27, 12:21 am |
| You can pass arrays via GET using the syntax:
http://localhost/index.php?val[1]=one&val[2]=2&...val[key]=value
Andy
Pete M wrote:[color=darkred]
> http://localhost/index.php?val_one=one&val2=2
>
> on index.php
> print_r($_GET) will show the array
>
> echo "val l=".$_GET['val_one'];
> echo "val 2=".$_GET['val2'];
>
> its CAse senSitivE
>
> you can also do a
> foreach($_GET as $k => $v)
> {
> echo $k."=".$v;
> }
>
>
> Sukanto Kho wrote:
>
|
|
|
|
|