-2

I'd like to check if a string is equal to another string. By equal, I mean that I want to check if the second string includes the first one in order to make mysql join's in a dynamic way. (I hope I'm clear, sorry for my english...)

I've seen some functions as strcmp() but it only checks if it is purely equal. It's the same as "$var1 === $var2".

Is there a function which can do that ? Or could you give me some leads to do that ?

Vivek Singh
  • 2,453
  • 1
  • 14
  • 27
CocoFlouq
  • 27
  • 7

1 Answers1

1
if (strpos($a,'are') !== false) {
    echo 'true';
}

How do I check if a string contains a specific word in PHP?

Community
  • 1
  • 1
Frank
  • 664
  • 5
  • 15