What’s wrong with this syntax?
echo array_keys($_SESSION['tablearray'])[0];
What’s wrong with this syntax?
echo array_keys($_SESSION['tablearray'])[0];
Trying to access array values directly from a function call, as you are trying to do, is currently* not allowed. You either need to use some other way to get at the information that you want.
// preferred
$keys = array_keys($_SESSION['tablearray']);
echo $keys[0];
// alternative (both of the following assume you want to get the first key)
echo current(array_keys($_SESSION['tablearray']));
// or
reset($_SESSION['tablearray']);
echo key($_SESSION['tablearray']);