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! Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Solution aub Posted April 27, 2014 Author Solution 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.