!strpos() php
$myString = 'Hello Bob how are you?';
if (strpos($myString, 'Bob') !== false) {
echo "My string contains Bob";
}<?php
$mystring = 'abc';
$findme = 'a';
$pos = strpos($mystring, $findme);
// Note our use of ===. Simply == would not work as expected
// because the position of 'a' was the 0th (first) character.
if ($pos === false) {
echo "The string '$findme' was not found in the string '$mystring'";
} else {
echo "The string '$findme' was found in the string '$mystring'";
echo " and exists at position $pos";
}
?>
Also in PHP:
- array unique in php using a column
- count length of string pphp
- carbon check sunday
- codeigniter last insert id example
- error_reporting e_all
- Carbon\Carbon::today()->format('Y-m-d') in blade
- Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:
- add month from date php
- Delete Query with Where Condition in Codeigniter
- base64 to image
- Jan 5, 2021 15:37:25 time format php
- failed to open stream: no such file or directory php
- check a word in a string
- count() parameter must be an array or an object that implements countable laravel
- DateTime::diff()
- find characters in word php
- eamble php erorors
- Builder::unique() laravel
- date time with am pm in php
- date( w ) php
- combox with auto filter, auto search cakephp
- ** (process:82385): CRITICAL **: 22:54:20.169: string_replace: assertion 'self != NULL' failed
- create model controller migration factory laravel in one command
- drop down list display only seleted item only