note 31959 added to function.base64-encode

From: Date: Sat, 10 May 2003 10:02:10 +0000
Subject: note 31959 added to function.base64-encode
Groups: php.notes 
Request: Send a blank email to php-notes+get-47813@lists.php.net to get a copy of this message
I had to send a php array trough a FORM in HTML, and came up with this solution: <? $array[] = array("foo", "bar"); $coded_array = base64_encode(serialize($array)); ?> now u can put the $coded_array into an input field or even a GET link ex: <a href="some_script.php?coded_array=<?=$coded_array;?>">script link</a> after receiving it in the script you send it to, do the following: <? $coded_array = $_GET["coded_array"] // or $_POST off course $array = unserialize(base64_decode($coded_array); ?> -- http://www.php.net/manual/en/function.base64-encode.php http://master.php.net/manage/user-notes.php?action=edit+31959 http://master.php.net/manage/user-notes.php?action=delete+31959 http://master.php.net/manage/user-notes.php?action=reject+31959

« previous php.notes (#47813) next »