Advertisement
koki2000

sorbarendez

Oct 16th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.33 KB | None | 0 0
  1. <?php
  2. $numbers = [1,3,4,2,5,8,6,7,9];
  3.  
  4. $seged = [];
  5.  
  6. for($i = 0; $i<count($numbers); $i++)
  7. {
  8.    
  9.         foreach($numbers as $num)
  10.         {
  11.  
  12.                 if($i == $num)
  13.                 {
  14.                         $seged[] = $num;
  15.                 }
  16.        
  17.         }
  18. }
  19.  
  20. $numbers = $seged;
  21. //print "<pre>";
  22. var_dump($numbers);
  23. //print "</pre>";
  24.    
  25.     //print_r($seged);
  26.     //print "</br>";
  27.    
  28.  
  29.  
  30. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement