I need to set a variable = to an array element. $var = $ary[1]; does not work. ary[1]= "test". If that helps
4 Answers
PHP arrays are zero indexed, that may be your problem
$ary = array("test");
$var = $ary[0]
$var == "test"
1 Comment
Iman Marashi
how to use it for
$content = array( "en" => $massage ); This is the way to set a variable with array elemen.
why it is not working , please check your array content .
$var = $ary[1]is certainly a valid assignment.