Skip to content
Advertisement

Looping from an array display a non wanted character with PHP

I have this array in PHP:

JavaScript

I want to loop into the color array like this:

JavaScript

The problem, is the first result is b from block.

How can I change this behavior ?

Thanks.

Advertisement

Answer

You can check whether the name element exists in the $color value:

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement