Answers for "how to check string exist in php"

PHP
8

check if text exists in string php

$a = 'How are you?';

if (strpos($a, 'are') !== false) {
    echo 'true';
}
Posted by: Guest on October-18-2020
0

check exist string in string php

$myString = 'Hello Learn Tech Tips (Zidane)?';
if (strpos($myString, 'Zidane') !== false) {
    echo "This string contains Zidane";
}
Posted by: Guest on November-04-2021
0

if exists in string php

if (strpos($search, ' -') !== false) {
  echo 'There is exclude pattern "-" in search expression';
}
Posted by: Guest on March-02-2022

Code answers related to "how to check string exist in php"

Browse Popular Code Answers by Language