What does the array p[in PHP mean?
$g = Array ();
foreach ($re as $key = $val)
{
$g [] = new Class_a ($val);
}
P[] represents the current array pointer?
Reply to discussion (solution)
The manual has:
New/modified with square brackets syntax
You can change an existing array by explicitly setting the value.
This is done by assigning a value to the array by specifying the key name within the square brackets. You can also omit the key name, in which case a pair of empty brackets ("[]") are added to the variable name. $arr [key] = value;
$arr [] = value;
Key can be an integer or string
Value can be any value.
$g [] is assigned to the array $g, and in your case the index starts at 0.
$g [] is an empty array.
Thanks to the 2-bit version and zy205817,
You can omit the key name, in which case the variable name is given a pair of empty brackets ("[]"). $arr [key] = value;
$arr [] = value;
Mi understand.