check if a string contain a substring php
$myString = 'Hello Bob how are you?';
if (strpos($myString, 'Bob') !== false) {
echo "My string contains Bob";
}// returns true if $needle is a substring of $haystack
function contains($haystack, $needle){
return strpos($haystack, $needle) !== false;
}
Also in PHP:
- check if key exists in array php
- convert to string php
- check of string is present in string using php
- Undefined offset: 0 at laravel\framework\src\Illuminate\Routing\Router.php
- check if something is on a string php
- Allowed memory size of 1610612736 bytes exhausted php on mac
- cache clear command in larvel
- console() php
- check if a key exists in array php
- console log php inside string
- file_get_contents() ssl operation failed
- check array key exists php javascript
- add days and time to date php
- -5 php change timezone
- advance custon feilds
- clear all caches laravel
- Associative array in php
- Multi-idiomas com PHP
- find characters in word php
- Where are WordPress Pages and Posts Stored
- adding 2 in date() php
- date() php -1heure?
- Allowed memory size of 1610612736 b
- find location from an ip address PHP