Using Substring Alternatives : stristr « String « PHP






Using Substring Alternatives

 
//string strstr ( string haystack, string needle ) 
//string stristr ( string haystack, string needle ) 

<?php 

$url = "www.java2s.com"; 

$domain = strstr ($url, "."); 

echo $domain; 
?>
  
  








Related examples in the same category

1.Detecting whether a string is contained in another string