check character in string php
$myString = 'Hello Bob how are you?';
if (strpos($myString, 'Bob') !== false) {
echo "My string contains Bob";
}$mystring = 'abc';
$findme = 'a';
$pos = strpos($mystring, $findme);strpos ( string $haystack , mixed $needle [, int $offset = 0 ] ) : int// returns true if $needle is a substring of $haystack
function contains($haystack, $needle){
return strpos($haystack, $needle) !== false;
}$a = 'How are you?';
if (strpos($a, 'are') !== false) {
echo 'true';
}
Also in PHP:
- datetime(today, Mtime) php
- .length php
- day plus one php
- PaymentIntent::create laravel
- create project command in laravel
- date formant php
- check ip php
- PHP Warning: PHP Startup: Unable to load dynamic library 'openssl' window
- date forat in php
- check if a word is present inside a string in php
- contains in string php
- Str::is() laravel examples
- .htaccess codeigniter
- create custom image size wordpress
- convert any uppercase to capitalize in php
- Assume that a database connection is established using a PDO object named $db
- echo in php console log
- error print php
- Best documentation tools for php
- ->count_all_results() in code igniter
- creating a new project with laravel
- array to string separated by comma php
- composer install laravel latest version
- echo console.log