Search
 
SCRIPT & CODE EXAMPLE
 

PHP

PHP stripos — Find the position of the first occurrence of a case-insensitive substring in a string

<?php
$findme    = 'a';
$mystring1 = 'xyz';
$mystring2 = 'ABC';

$pos1 = stripos($mystring1, $findme);
$pos2 = stripos($mystring2, $findme);

// Nope, 'a' is certainly not in 'xyz'
if ($pos1 === false) {
    echo "The string '$findme' was not found in the string '$mystring1'";
}

// Note our use of ===.  Simply == would not work as expected
// because the position of 'a' is the 0th (first) character.
if ($pos2 !== false) {
    echo "We found '$findme' in '$mystring2' at position $pos2";
}
?>
Comment

PREVIOUS NEXT
Code Example
Php :: recaptcha v3 laravel 8 
Php :: pluck only category name and id from model in laravel 
Php :: Route::whereIn 
Php :: Send Message from server laravel 
Php :: php populate select from array 
Php :: eloquentdatatable add column 
Php :: php calculate age as float 
Php :: multidimensional session-array 
Php :: php remove new line character from string 
Php :: cara looping abjad with array 
Php :: how to check null and empty array in laravel 8 
Php :: php refresh_ttl 
Php :: laravel migration softdelete 
Php :: Update database table row if a qualifying token is provided 
Php :: drupal 7 hook_node_insert 
Php :: pass guzzle client data to view laravel 
Php :: slow laravel testing 
Php :: kinsta check environment 
Php :: nested attributes - PHP 8.1 
Php :: envato purchase code verfication in php 
Php :: php raw array without foreach 
Php :: larvael die and dump facade 
Php :: Régler l’enregistrement automatique dans WordPress 
Php :: php loop through array shorthand 
Php :: php base64 encode utf8 
Php :: how to add in massive php 
Php :: laravel {{variable}} not being rendered 
Php :: Laravel efficient way to remove X records if there are duplicates 
Php :: Insert Data Into MySql Database Multiple Columns PHP Function 
Php :: laravel get fetch api request body 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =