string strstr ( string haystack, string needle ) finds the first occurrence of a substring inside another string (parameter one) : strstr « String « PHP






string strstr ( string haystack, string needle ) finds the first occurrence of a substring inside another string (parameter one)

 
<?
    $string = "http://www.example.com/mypage.php";
    $newstring = strstr($string, "www");
?>
  
  








Related examples in the same category

1.strstr function demo
2.strstr() function returns the remainder of string beginning at the first occurrence.
3.strstr.php
4.strtr() function converts all characters contained in destination to their corresponding character matches in source.
5.strtr.php