find if a string contain any of a given words 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:
- Does ,date('Y-m-d H:i:s') grab local pc or server pc time
- by default null eloquent user data in relationship in laravel 8
- does php reverse array function
- base encode64 php
- delete all post and attachments of a user delete codegrapper
- clear composer cache
- bu7scador con laravel
- date to year month php
- check if string contains specific string php
- date F month php
- automatic years php
- check aall routes laravel
- composer php version command
- array empty check in php
- current date time in php
- Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar://D:/Program Files/Composer - PHP/composer.phar/src/Composer/DependencyResolver/Solver.php on line 223
- array check if element contains key
- Call to a member function move() on string
- database seeding
- executar comando linux php
- echo err in php
- disable laravel passport
- date format php h
- disable wordpress updates