[HELP]PHP Challenge Explanation Needed
Hey guys please I will appreciate if I can be explained how the PHP challenge answers are gotten. I'll add more questions. Thanks!!! N0. 1 What will be the output of the code snippet? $x = array("aaa", "", "ccc", "ddd", ""); $y = array_unique($x); echo count($x).",".count($y); ANS: 5,4 N0.2 What is the output of this code? for($k = 0; $k < 8; $k++) if($k % 2!= 0){ if($k % 5 == 0) echo $k - 2; else echo $k; } ANS: 1337 N0.3 What is the output of this code? $arr = array("x" => array(1,2,3), "y" => 5); $y = 0; foreach($arr as $x) if(is_array($x)) foreach($x as $value) $y += $value; else $y *= $x; echo $y; ANS: 30 N0.4 What is the output of this code? $cats = array("Tom", "Joe", "Glenn", "Martie", "Jeff"); $queue = count($cats) + 4; echo $queue; $queue *= 1111; echo $queue; ANS:99999 N0.5 What is the output of this code? $i = 0; $num = 80; while($i < 20){ $num -= 2; $i += 0.5; } echo("$num"); ANS:0