find a word in a string 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:
- add days in datetime php
- datetime weekday php
- @ in php db connect
- code to log errors to web console
- default port for phpmyadmin
- cake tmp name
- MySQL integer field is returned as string in PHP
- codeigniter
- array push in php
- base64_encode php
- does include reload the page php
- file_get_contents(): SSL operation failed with code 1. jpeg
- SQLSTATE[42S02] lumen
- codeigniter get last query
- empty laravel cache
- artisan db:seed all
- echo json_encode json_pretty
- catch in php
- \w\d php
- date () u php
- date to dat_atom format in php
- doctrine mongodb native query
- $date php
- check in array key true or false php