make a request variable as array php code example
Example 1: assign array to variable php
$info = array('coffee', 'brown', 'caffeine');
list($drink, $color, $power) = $info;
echo "$drink is $color and $power makes it special.\n";
list($drink, , $power) = $info;
echo "$drink has $power.\n";
list( , , $power) = $info;
echo "I need $power!\n";
list($bar) = "abcde";
var_dump($bar);
Example 2: how to store array in variable php
$myArray = array("http://www.marleenvanlook.be/admin.php","http://www.marleenvanlook.be/checklogin.php","etc");
$i = 0;
foreach($myArray as $value){
${'something'.$i} = $value;
$i++;
}
echo $something0;