How do I use a loop to find $query value in an array and display a message "present" if the value is present? for example, I have @array= (1..10) I need to check if it has $query= "6" using loop. Thank you in advance!
Hydrogen Sulphide · Sep 16, 2013 3:28 AM · 10,541 views
foreach ( @array ) { print "present" if $_ == 6; }
dolphin · Sep 16, 2013 9:13 AM
This conversation is preserved exactly as it was on the original Sajha.com and can't accept new replies.
Start a New Discussion