[Solved] Notice: Array to string conversion ERROR [closed]


First you need to change:

foreach ($traits[$i] as $trait)

To:

foreach ($traits as $trait)

Then realize that $trait is still an array. So instead of

echo '<BR>'.$trait, $test, $i + 1;

You want to still loop through that array:

foreach($trait AS $value)

Now you can echo out your $value

foreach ($traits as $trait) {
    foreach($trait AS $value) {
        echo $value;
    }
}

Update: Between comments below and several question updates, it became clear what the desired output actually was. Final solution is here: http://3v4l.org/X3i3p

21

solved Notice: Array to string conversion ERROR [closed]