Jump to content

[TINY HELP] in_array


aub

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.