how to pass array in query string

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bugthefixer
Forum Contributor
Posts: 118
Joined: Mon Mar 22, 2004 2:35 am

how to pass array in query string

Post by bugthefixer »

How do i pass an array in query string
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Have a look at serialize() :)

Mac
choppsta
Forum Contributor
Posts: 114
Joined: Thu Jul 03, 2003 11:11 am

Post by choppsta »

you can also do:

Code: Select all

file.php?data[one]=x&data[two]=y&data[three]=z
$_GET['data'] will now be:

Code: Select all

Array
(
    [one] => x
    [two] => y
    [three] => z
)
Post Reply