Search
 
SCRIPT & CODE EXAMPLE
 

PHP

PHP strpos — Find the position of the first occurrence of a substring in a string

<?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";
}
?>
Comment

PREVIOUS NEXT
Code Example
Php :: <= in php 
Php :: eval base64 decode php 
Php :: wordpress deny user to access wp-admin programmatically 
Php :: add header image to woocomerce shop page 
Php :: cast_assoc 
Php :: PDF Library Persian Language UTF-8 Support mPDF Lib 
Php :: Convert backslash characters PHP 
Php :: php split string in half 
Php :: undefined type excel 
Php :: check session sweet alert 
Php :: wp woocommerce change product tags to checbox 
Php :: add variables to line in laravel notification 
Php :: Display HTML text from a variable in laravel 
Php :: PHP Superglobal - $_REQUEST 
Php :: send multiple attachment in mail laravel 8 
Php :: laravel post index method 
Php :: php get header language 
Php :: query builder laravel getmedia undefined method 
Php :: append data to json file php 
Php :: Limiter la révision des articles WordPress 
Php :: remove public from url laravel 7 
Php :: AWS S3 - accessing and working with JSON files 
Php :: set modes magento 2 
Php :: carbon parse 
Php :: php cors error 
Php :: php print array source code 
Php :: cara looping abjad with array 
Php :: copy(/Users/admin/Library/Caches/composer/files/fakerphp/faker 
Php :: curl upload image huawei 
Php :: data validation of $_POST in php 
ADD CONTENT
Topic
Content
Source link
Name
8+7 =