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!
foreach ( @array ) { print "present" if $_ == 6; }
Please log in to reply to this post
You can also log in using your Facebook
What people are reading
You might like these other discussions...
· Posts 9
· Viewed 12662
· Likes 1
· Posts 7
· Viewed 4102
· Likes 1
· Posts 21
· Viewed 10252
· Likes 1
· Posts 5
· Viewed 7865
· Likes 1