We will create an array and assign multiple values to this array like this $my_data = array(“mydata1”,”mydata2”,”mydata3”, “Mydata”); You can check the presence of any element inside the array by using in_array() function.