Advertisement
bug7sec

asort explode

Feb 8th, 2017
366
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.36 KB | None | 0 0
  1. <?php
  2. error_reporting(0);
  3. // list formar num a|num b|num c
  4. $file = file_get_contents("list.txt");
  5. $file = explode("\r\n", $file);
  6. foreach ($file as $key => $num) {
  7.     $num = explode("|", $num);
  8.     $tmp[] =  $num[2];
  9.     $crd[] =  $num[0]."|".$num[1];
  10. }
  11. asort($tmp);
  12. foreach ($tmp as $key => $is) {
  13.     echo $crd[$key]." | Saldo ".number_format($is,0,',','.')."\r\n";
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement