Answers for "how to check for characters in a string php"

PHP
3

if text contains word then in php

if (strpos($haystack,$needle) !== false) {
    echo "$haystack contains $needle";
}
Posted by: Guest on July-16-2020
1

php check if string contains a char

$haystack = 'This is my haystack that we shall check'
$has_A = strpos($haystack, 'A') !== false;
$has_a = strpos($haystack, 'a') !== false;
Posted by: Guest on August-04-2020

Code answers related to "how to check for characters in a string php"

Browse Popular Code Answers by Language