2010-06-07 6 views
4

Tous,Get variables POST est un tableau

je les variables cachées suivantes:

<input type="hidden" name="chk[10]" value = "cats"> 
<input type="hidden" name="chk[13]" value = "dogs"> 
<input type="hidden" name="chk[14]" value = "fish"> 

Je veux obtenir ces variables par la méthode POST et les imprimer. Comment puis-je faire cela en PHP?

Merci

+0

http://php.net/types.array http://php.net/manual/en/control-structures.foreach.php –

Répondre

8
foreach($_POST['chk'] as $key => $value) { 
    echo $key, ' => ', $value, '<br />'; 
} 
2
$chks = $_POST["chk"]; 
print_r($chks);