Why can't I immediately access elements in the array returned by explode()
?
For example, this doesn't work:
$username = explode('.',$thread_user)[1];
//Parse error: syntax error, unexpected '[
But this code does:
$username = explode('.',$thread_user);
$username = $username[1];
I don't usually program in PHP, so this is rather confusing to me.