Answers for "php check if part of string exists"

PHP
5

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
5

php find if substring is in string

$result = strpos("haystack", "needle");

if ($result != false)
{
  // text found
}
Posted by: Guest on March-13-2020

Code answers related to "php check if part of string exists"

Browse Popular Code Answers by Language