Guest User

Untitled

a guest
Jul 17th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.56 KB | None | 0 0
  1. <?php
  2.     $x = 1;
  3.     $y = 5;
  4.    
  5.     for($i = $x; $i < $y; $i++){
  6.         //Função str_repeat feita na mão.
  7.        
  8.         for($a = 0; $a < 3; $a++){
  9.             $str[] = $i;
  10.         }
  11.     }
  12.    
  13.     $str = implode("", $str);
  14.    
  15.     $count = strlen($str);
  16.    
  17.     for($i = 1; $i <= $count; $i++){
  18.         $iVal = ($i - 1);
  19.         $stringPos = $str[$iVal];
  20.        
  21.         $multiplo = (($i % 5) == 0);
  22.        
  23.         echo $stringPos;
  24.        
  25.         if($multiplo){
  26.             echo '<br />';
  27.         }
  28.        
  29.        
  30.  
  31.     }
Add Comment
Please, Sign In to add comment