开发者

PHP Defining array variable within logical operator

I'm trying to define a point in an array within a logical operator. Is this po开发者_如何学JAVAssible?

e.g.

$a = $deg[0];
$b = $deg[1];
$c = $deg[2];
$d = $deg[3];
$e = $deg[4];

if ($c == False){
$array['$a']['$b'][0][1] = $value;


} else {

if ($d == False){
$array['$a']['$b']['$c'][0][1] = $value;


} else {

if ($e == False){
$array['$a']['$b']['$c']['$d'][0][1] = $value;
}

Is there a reason the array variable is not being defined?


start with removing ' single quotes

$array[$a][$b][0][1] = $value;

and it not wise to use key word like array as variable name

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜