If you used strict, you'd see why. The scoping of $city is such that it's not available when you declare your array. Somehow you need to keep the appropriate city value after you've found a match. (What if you assigned it to $found, and then checked if $found is empty instead of if it's zero?)
In reply to Re: **HomeWork** Printing the found input from an array
by chromatic
in thread **HomeWork** Printing the found input from an array
by trenchwar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |