check out the serialize() and unserialize() functions in the manual.

replace this:
print("<A HREF=new_page?arr=$array> sort </a>");

with this
<a href="new_page.php?arr=<? echo(urlencode(serialize($array))); ?>"> sort </a>

Excerpt from the manual:
http://www.php.net/manual/en/function.serialize.php

If you are passing serialized data between pages in hidden form
fields (or in a query string), you need to serialize() the data,
then *urlencode()* it, then put it in the hidden field.
When you get to the next page, urldecode() it, then unserialize().

-Jason Garber
www.deltacron.com



At 11:15 PM 9/26/2001 +0200, you wrote:
>Hi,
>
>I have an array witch I display in my browser. Now I want to create a button
>sort which sorts the array.
>
>Problem is how to pass the array?
>I tried:
>
>print("<A HREF=new_page?arr=$array> sort </a>");
>
>I know I can reload the page and insert a function sort but it would be
>stupid because the array has to be filled twice.
>
>Any suggestions?
>
>Thanks!
>
>
>
>
>
>--
>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]

Reply via email to