string strstr ( string haystack, string needle ) finds the first occurrence of a substring inside another string (parameter one) : strstr « String « PHP
- PHP
- String
- strstr
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