Last Updated: February 25, 2016
·
759
· urielmaniaco

Array en un campo “hidden” de un Formulario

Hay que serializar el array para enviarlo por el URL o en un formulario en un campo “hidden” … Y, en el script que reciba el array debera de des-serializarlo.
<?
function array_envia($array) {

$tmp = serialize($array);
$tmp = urlencode($tmp);

return $tmp;
}

<?
function arrayrecibe($urlarray) {
$tmp = stripslashes($url_array);
$tmp = urldecode($tmp);
$tmp = unserialize($tmp);

return $tmp;
}

Link

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Did you know?

PHP applications still send a browser full of JavaScript. Hardening the server does not inventory the payment, analytics, and plugin scripts that run after the HTML is delivered.

Security insights from Cside