I've ceated a PHP Array which output looks like the following:
Array (
[1429645] => Array (
[name] => John Smith
[days_employed] => 15
[wage] => 25000
)
[1183240] => Array (
[name] => Sarah Smith
[days_employed] => 65
[wage] => 30000
)
)
I am going to be looping through the data to create a table, however I'm trying to understand what I have and print some data of like so;
<?PHP echo print_r($employeeData[0][wage]); ?>
The above intent was; first employee => wage => value
After several attempts, several dozen pages being looked at, trying with and without speech emphasis, nothing appears to have given any output apart from at one point I saw 1 dispite that not being a value I could relate to.
Have I created a standard PHP array and how can I read values correctly?
[0]as no element exists with 0 as a key. You could tryecho reset($arr)['wage'];