$_POST serialize unserialize
Bonjour
j'essaye de passer un tableau en post.
En lisant les forums j'ai vu qu'il fallait faire un serialize et unserialize mais au retour en unserializant mon array est vide, ou plus exactement il y a seulement la ligne 0 avec aucune données associées.
formulaire
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
| <?php $tabmodif = $_POST['modif-multiple'];
$tablto=$_POST['ficheLTO'];
print_r($tablto);
// serialize le tableau
$tablto2= serialize($tablto);
// test de recuperation a cet endroit ça fonctionne
$tablto3=array(unserialize($tablto2));
print_r($tablto3);
IF(!EMPTY($tablto)){?>
<center>
Indiquez le N° de LTO ou sont stockés les Master
<input type="texte" name="masterLTO">
<input type="hidden" name="tablto" value="<?php echo $tablto2 ?>"> |
récupération des données
Code:
1 2 3
| tablto=array(unserialize($_POST['tablto']));
$numdulto=$_POST['masterLTO'];
print_r($tablto); |