check if part of the srint is in other string php
$myString = 'Hello Bob how are you?';
if (strpos($myString, 'Bob') !== false) {
echo "My string contains Bob";
}if (strpos($a, 'are') !== false) {
echo 'true';
}// returns true if $needle is a substring of $haystack
function contains($haystack, $needle){
return strpos($haystack, $needle) !== false;
}
Also in PHP:
- basd64 decrtpy php
- clearing cache on live site laravel
- create laravel 5.8 project using composer
- Auth::user() id
- Auth::getUser();
- 4random numbers php
- base64 decode php function
- LARAVEL migrate error
- check if a string contain a substring php
- clear cache routes laravel
- eloquent remove updated_at
- carbon compare same date
- Syntax error or access violation: 1071 Specified key was too long; max key length is 1000
- Laravel purge file cache
- exclude php
- date to string php
- define header in php
- day of week count in php
- catch multiple exception php
- file_get_contents() ssl operation failed
- check character present in sentence in phph
- downloading php latest version for ubuntu 20.04 using terminal
- abcabc find matching substrings in a string php
- display php error on basic