[] after varaible

What does [] mean next to variable ?

$result[$owner][] = $file;


The [] in that line of code appends a numerically indexed element to the array, similar to, but not exactly the same as array_push(). See the [] example at this link to the documentation - PHP: array_push - Manual

1 Like
Sponsor our Newsletter | Privacy Policy | Terms of Service