jeudi 20 août 2015

In PHP, is it possible to set a variable name using a string?

I have a piece of code like

$id = $_POST['id'];
$name = $_POST['name'];
$story = $_POST['story'];
$imgurl = $_POST['imgurl'];
$thisAction = $_POST['thisAction'];

As you can see, the variable names I'm using are equal to the keys of the $_POST array. Is it possible to accomplish the above with a loop?

Aucun commentaire:

Enregistrer un commentaire