Re: array
| From: | Jason G. | Date: | Thu, 27 Sep 2001 07:36:00 +0000 |
| Subject: | Re: array | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-68955@lists.php.net to get a copy of this message | ||
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: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net