Advertisement
rana

file parsing

Nov 11th, 2011
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.44 KB | None | 0 0
  1. <?php
  2.     $handle = fopen('http://webnew.dsebd.org/admin-real/datafile/quotes.txt', 'r');
  3.     $my_array = array();
  4.     while ( !feof($handle))
  5.     {
  6.         $text = fgets($handle);
  7.         array_push($my_array, $text);      
  8.     }
  9.     $codes = array();
  10.     $price = array();
  11.     $test_array = array();
  12.     for ($i = 4; $i < count($my_array); $i ++)
  13.     {
  14.         $test_array[] = preg_split('/\s+/', trim($my_array[$i]));
  15.     }
  16.     echo '<pre>';
  17.     var_dump($test_array);
  18.     echo '<pre/>';
  19.    
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement