Tuesday, October 21, 2014

String function in php


 <?php  
      $sentence = "I lob to have tea but some time I prefer coffee";  
      //replacing tea from above sentence by milk with str_replace function  
      echo str_replace("tea","milk",$sentence);  
 ?>  

No comments:

Post a Comment