Answers for "find php"

PHP
13

strpos in php

<?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";
}
?>
Posted by: Guest on March-13-2020
1

php needle haystack

//Find the position of the first occurrence of a substring in a string
$mystring = 'abc';
$findme   = 'a';
$pos = strpos($mystring, $findme);
Posted by: Guest on May-08-2020
0

php indexof

strrpos ( string $haystack , mixed $needle [, int $offset = 0 ] ) : int or False return
<?php
$foo = "0123456789a123456789b123456789c";

// Looking for '0' from the 0th byte (from the beginning)
var_dump(strrpos($foo, '0', 0));

// Looking for '0' from the 1st byte (after byte "0")
var_dump(strrpos($foo, '0', 1));

$str = 'This is Main String';
 
if (strpos($str, 'This') !== false) {
    echo 'true';
}
Posted by: Guest on November-01-2020
0

find php ini

1. Create test.php file with the following content

2. <?php phpinfo(); ?>

3. Put it in the root of the site (or in a public folder)

4. Open the file on your browser "domaine.com/test.php"

4. Look for "Loaded Configuration File"
Posted by: Guest on June-09-2021

Browse Popular Code Answers by Language