I am trying to write out all the array values using a while
loop but it isn't working, any tips?
$console = array("Wii","Playstation 3","Xbox","Dator");
echo "I like " .$console[0] . " and " . $console[1] . ".";
while($console <5){
echo "The console you like is: $console <br>";
$x++;
}
My first echo
is visible but the second one in my loop is not, what have I done wrong? The while
loop should be able to show all 4 consoles variables but it doesn't show anything.