You are here: Re: [PHP] Passing Arrays between pages « PHP « IT news, forums, messages
Re: [PHP] Passing Arrays between pages

Posted by PartyPosters on 10/16/58 11:11

Thanks for all your help!!! managed it with -
$testArray = implode('|', $testArray);
On next page: $testArray = explode('|', $testArray);


----- Original Message -----
From: <afan@afan.net>
To: "PartyPosters" <sales@partyposters.co.uk>
Cc: <php-general@lists.php.net>
Sent: Tuesday, March 22, 2005 10:06 PM
Subject: Re: [PHP] Passing Arrays between pages


> 1. you can put your array in string using implode() function and on next
> page create the array back using explode() function.
> $testArray = implode('|', $testArray);
> # you will get: "Apple|Banana|Peach"
> On next page: $testArray = explode('|', $testArray);
>
> 2. use serialize()/unserialize() functions
>
> For more info read manual.
>
> -afan
>
> PartyPosters wrote:
>
> >Hello,
> >Please can someone tell me how you pass arrays between PHP pages.
> >I have tried something like this and have tried many variations of this
but
> >nothing working yet ;
> >
> >
> >Page 1
> >$testArray[0] =Apple;
> >$testArray[1] =Banana;
> >$testArray[2] =Peach;
> >
> >echo "<INPUT NAME = \"kcompany[]\" TYPE = \"hidden\"
VALUE=\"$testArray\">";
> >
> >Page2
> >echo $testArray[1];
> >
> >
> >On different variations of this I keep on getting 'Array' when I to
return the variable on the second page
> >
> >Many Thanks.
> >Kaan.
> >
> >
> >
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация