I'm trying to add an array element so that it can be referenced as:
$url_list['some_id']['url']
and
$url_list['some_id']['time']
Here is the code:
$url_list[] = [ $eswc_id ][ 'url' => wp_get_referer(), 'time' => time() ];
It causes an error:
Parse error: syntax error, unexpected '=>' (T_DOUBLE_ARROW), expecting ']'
I'm new to PHP, I tried $eswc_id
without the brackets and $url_list +=
instead of $url_list[] =
but I'm getting the same error, how can I fix the syntax?