I have array that looks like this when I var_dump()
it:
array(1) { ["bussiness"]=> array(5) { [0]=> string(8) "business" [1]=> string(9) "bossiness" [2]=> string(8) "busyness" [3]=> string(9) "bushiness" [4]=> string(9) "fussiness" } }
I am trying to get each of those elements to be an inside a single .
I thought it would be as simple as iterating through the array with a foreach and echoing each element in the array inbetween an and , but I am trying that and it doesn't seem to be working.
The output that I am getting is a with two s one says Array and the other is blank.
So the markup is like this:
<select>
<option>Array</option>
<option></option>
</select>
What am I doing wrong and why isn't the code echoing the array's contents. It is not even iterating through the entire array, just two items hence the two s.
Here is my code:
var_dump($bad_words);
echo "Did you mean: <select>
";
foreach($bad_words as $suggestion){
echo "<option>".$suggestion."</option>
";
}
echo "</select>";