如何从这个数组中回显出“用户名”?
array(2) {
["data"]=>
array(2) {
[0]=>
string(14) "username taken"
[1]=>
string(20) "email already in use"
}
["error"]=>
NULL
}
答案 0 :(得分:1)
试试这个:
//define the array
$array = array("data"=>array("username taken","email already in use"),array("error"=>NULL));
//output full array
var_dump($array);
//output first element of data
echo "<br>".$array["data"][0];
答案 1 :(得分:0)
echo $variableNameOfArray["data"]["0"];
应该做的伎俩。