jeudi 9 juin 2016

Create multiple variables in loop?

I need to create 2 variables, and 34 of each of them.

$found1 > $found34

$name1 > $name34

I tried creating them in a for loop, but they are not available outside the loop.

is there a simple way to create these globally in a php page ?

Here is the test I tried

for($i = 0; $i <= 33; $i++) {
  $found[$i] = "David".$i;
}

echo "Found 3: " . $found3;

Aucun commentaire:

Enregistrer un commentaire