Something about using $array_increment++ to fill an array seem inefficient, even though it works.
Is there a more efficient way to fill $color_names in the code below than using a variable to walk through the array? Since I'm using a foreach and 'if' to fill the array, it's harder to figure out a different way than using ++.
$array_increment = 0;
foreach ($tokens as $token)
{
if(is_array($token))
{
if(token_name($token[0]) === "T_STRING")
{
$color_names[$array_increment] = $token[1];
$array_increment++;
}
}
}