php arrays

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Can i send an array from one php script to another? If so, how?
Thanks Wes

Re: php arrays writes:

Quoted text here. Click to load it

Serialize the array or send it via a html form or use a session
variable: eks,

$_SESSION["myarray"] = serialize($myarray);

Then on the dest. page you can use $myarray = unserialize($_SESSION["myarray"]);

Henrik Hansen

Re: php arrays

Henrik Hansen wrote:

Quoted text here. Click to load it

Just one addition:

Henrik's examples are OK, but in case of Session, you do not have to  
serialize, this will be done by the sessionhandler before storing.

In case of POST of GET: Yes please: Serialize AND do urlencoding to be sure  
all characters are transmitted safely.

For testing, be sure you add some newlines and ' and " and & into the  
information stored in the arrays, to check if they all get transmitted  

Erwin Moller

Re: php arrays

Thanks, i actually am using a session. So i think i will make them
session variables.

Site Timeline