Share icon

n PHP sometimes we need to find the specific word in the string for the programitically use the code, there is a function called "strpos()" will help to do this.

example:

 

$string = 'this is website name is key2goal';

if (strpos($string, 'key2goal') !== false) {
    echo "Found";
}

Please Comment your thoughts and feedback below and add something if you found good in anywhere to help others

Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.