^

Check if String exists in String

Article 58 in PHP

2020-11-07 16:04:34 from bugfish
Check if String exists in String
PHP / String Operations
Last Review on: 2021-05-06 12:24:31 | Hits: 126

 Here code to check if a string exists in another string!

$string = 'This is a String';
if (strpos($string , 'This') !== false) {
    echo 'true'; # STRING CONTAINS WORD "This"
} else {
# String not found inside $string
}

 

I do not guarantee the reliability of the information given here, the code described on this page is executed at your own risk and in the event of damage or other unforeseeable consequences I am in no way responsible or liable.
Comment Section
Currently 0 Upvotes!
captcha image

System - 2021-01-01 19:30:37
We appreciate comments on our site!

This Website is using Session Cookies for Site Functionality and AWStats.
Radio