$canada_territories = array("British Columbia" => "British Columbia", "Manitoba" => "Manitoba", "New Brunswick" => "New Brunswick", "Newfoundland and Labrador" => "Newfoundland and Labrador", "Nova Scotia" => "Nova Scotia", "Northwest Territories" => "Northwest Territories", "Nunavut" => "Nunavut", "Ontario" => "Ontario", "Prince Edward Island" => "Prince Edward Island", "Quebec" => "Quebec", "Saskatchewan" => "Saskatchewan", "Yukon" => "Yukon");
print_r($canada_territories);
Ends up being
Array ( [British Columbia [Manitoba]] => British Columbia [Manitoba] => Manitoba [New Brunswick] => New Brunswick [Newfoundland and Labrador] => Newfoundland and Labrador [Nova Scotia] => Nova Scotia [Northwest Territories] => Northwest Territories [Nunavut] => Nunavut [Ontario] => Ontario [Prince Edward Island] => Prince Edward Island [Quebec] => Quebec [Saskatchewan] => Saskatchewan [Yukon] => Yukon )
ritish Columbia [Manitoba] is where it starts to go wrong by adding part of the next array item
What is causing this?
I am trying to build this array to populate a dropdown form,i don't know enough about array, do I even really need to add British Columbia to the array twice to be able to cycle through them?
This is what I usually use but it usually has a key and value that I set, on this case I need to show the value twice below where I usually show 2 different values
foreach ($state_array as $sid => $statename) {
print '<option value=' . $sid . $selected . '>' . $statename . '</option>';
}
UPDATE
I wasnt wrapping with tags and it showed up how I posted in chrome, when I view source it is actually correct