Hello,
Im pretty new to PHP so excuse my dumbness
I've searched this up in quite a few places and cant find anything : (
Basically, I've made an array, within it are 3 more arrays
Their are two values in each array, 'Name' and 'Age'
Basically Im using a While statement to try and cycle through the 'age' value of my array and state whether or not the person is eligible.
(Im actually just learning so I'm doing this to just test myself)
Here is my code
Code:
<?php
$people =array(
array('name' => 'Bob', 'age' => 15 ),
array('name' => 'Jhon' , 'age' => 10),
array('name' => 'Sue' , 'age' => 7));
//($value =& $people[0,1,2][age] ); Here was an attempt to try and create a reference to age, i tried it many different ways
while($age < 10) {
echo ('$name, is elligible')
;
}
?>
Okay, so I tried to do this through two ways, one way i tried to create a reference to age, then evaluate it, without that line of code their would be no reference, which way is correct, why wont it work?
Im using Xammp, so when i launch local host I get an undefined variable error
What To Do?