Answers for "strstr php"

PHP
65

php strpos

$myString = 'Hello Bob how are you?';
if (strpos($myString, 'Bob') !== false) {
    echo "My string contains Bob";
}
Posted by: Guest on August-06-2019
2

php stristr

#Case-insensitive strstr()
#stristr(string $haystack, string $needle, bool $before_needle = false): string|false
#Returns all of haystack starting from and including the first occurrence of needle to the end.

<?php
  $email = '[email protected]';
  echo stristr($email, 'e'); // outputs [email protected]
  echo stristr($email, 'e', true); // outputs US
?>
Posted by: Guest on August-11-2021
0

stristr php

<?php
  $string = 'Hello World!';
  if(stristr($string, 'terre') === FALSE) {
   echo '"terre" non trouvé dans la chaîne de caractères';
  }
// affiche : "terre" non trouvé dans la chaîne de caractères
?>
Posted by: Guest on April-03-2020
1

php stristr

stristr ( string $haystack , mixed $needle [, bool $before_needle = FALSE ] ) : string
Posted by: Guest on April-09-2020

Browse Popular Code Answers by Language