aub Posted April 27, 2014 Share Posted April 27, 2014 Hi guys, just need your tiny help. I'm learning as you can see.The question says: Create a script to check if the value "Sydney" is stored in the following array (hint: use function: in_array) $cities = array("New York", "London", "Sydney", "Paris", "Brisbane")(Note: you must print the ending result) This is my code: <?php $cities = array("New York", "London", "Sydney", "Paris", "Brisbane") if (in_array("Sydney", $cities)) { echo "Yes, Sydney is stored!"; } ?> I cant fix the problem? Your help would be lovely. Thanks! Link to comment https://forums.phpfreaks.com/topic/288060-tiny-help-in_array/ Share on other sites More sharing options...
Ch0cu3r Posted April 27, 2014 Share Posted April 27, 2014 You have a left of the semi-colon at the end of the second line $cities = array("New York", "London", "Sydney", "Paris", "Brisbane"); // <-- missing semi-colon Link to comment https://forums.phpfreaks.com/topic/288060-tiny-help-in_array/#findComment-1477442 Share on other sites More sharing options...
aub Posted April 27, 2014 Author Share Posted April 27, 2014 You have a left of the semi-colon at the end of the second line $cities = array("New York", "London", "Sydney", "Paris", "Brisbane"); // <-- missing semi-colon Oh my friggin god! What the hell? How embarrassing! Thanks for the help! Really appreciate it. Link to comment https://forums.phpfreaks.com/topic/288060-tiny-help-in_array/#findComment-1477443 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.