If you have an array that contains a hundred different values, you may be wondering how you can check if that array contains a certain string. As you may already know, you can use the foreach() function to echo out each value contained inside the array. But lets imagine that we simply want to execute a line of code if our array contains a certain string.
Thankfully, there is an easy way to do this.
Ok, now the fun part. We are going to use the in_array() function to see check if our array contains a certain string.