Advertisement
shaashwato1308

PHP - function - Adding Breaker Before Dot

Feb 2nd, 2015
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.31 KB | None | 0 0
  1. function addBreakerBeforeDot($string){
  2.     $len = strlen($string);
  3.     $toReturn = "";
  4.     for($c = 0; $c < $len; $c++){
  5.         if($string[$c] == "."){
  6.             // echo "found<br>";
  7.             $toReturn = $toReturn."\\\\". $string[$c];
  8.            
  9.         }else{
  10.             // echo "not found<br>";
  11.             $toReturn .= $string[$c];
  12.         }
  13.     }
  14.     return $toReturn;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement