3w PHP Your Source for PHP Source Code


Checking if string exist in array values

In  this sample, we create array with names for a group.
Then we check to see if a specific name is in the group...

Here is the sample.

// Array of names in group
$array = array('Sam' , 'Louis' , 'Samentha' , 'Joe');
if (in_array('Joe',$array))
	echo 'Joe is in group...';

Thank you and please, do not hesitate to comment.

Comments (2) Trackbacks (0)
  1. hello

Leave a comment


No trackbacks yet.