Say that I have a PHP array like so:
$marr = array(
"name" => "John",
"age" => 33
);
print_r($marr[0]);
This code gives me an error of Undefined offset: 0.
What I am trying to achieve is to print the name
part of the array without specifying it in my print request, and instead doing it via an index number. So instead of having to print $marr['name']
is there a way for me to just assign an index, much like what I tried to do in my example?