How To pass an Array in the Querystring Using PHP

December 18, 2009

I recently ran across a silly WordPress situation where I needed to pass an array in the querystring.  Here’s what I came up with:

$array = array('a' => 1, 'b' => 2, 'c' => 3);
$array = rawurlencode(serialize($array));
echo 'Pass array';

Then on the receiving getarray.php:

$array = unserialize(stripslashes($_GET['error_array']));

Author

Stay in Touch!

Stay in Touch!
Solutions Architecture

browse through our blog articles

Blog Archive