title: Read txt file with php like database
body: <p>i export my sql database into text(database.txt) file like this:</p>
  
  <pre><code>id|name_sname|identity|address|region|hours|destination|price;
  --------------------------------------------------------------------
  1|Ezra Mod|123456789|husi, stanilesti, vaslui|HUSI - IASI|20:00|HUSI|100;
  2|Ezra Mod|123456789|husi, stanilesti, vaslui|HUSI - IASI|20:00|HUSI|100;
  3|Ezra Mod|123456789|husi, stanilesti, vaslui|HUSI - IASI|20:00|HUSI|100;
  4|Ezra Mod|123456789|husi, stanilesti, vaslui|HUSI - IASI|20:00|HUSI|100;
  5|Ezra Mod|123456789|husi, stanilesti, vaslui|HUSI - IASI|20:00|HUSI|100;
  6|Ezra Mod|123456789|husi, stanilesti, vaslui|HUSI - IASI|20:00|HUSI|100;
  </code></pre>
  
  <p>and now i want to read this file with php and put result from each row in another files: contracts.php?id=1 , where id need to be from my <strong>database.txt</strong> ,
  I try to read database.txt in this mode:</p>
  
  <pre><code>$data = file_get_contents("database.txt"); //read the file
  $convert = explode("|", $data); //create array separate by new line
  
  foreach($convert_row as $rand) {
      echo $rand;
      echo "&lt;br /&gt;&lt;hr /&gt;&lt;/br /&gt;";
  }
  </code></pre>
  
  <p>what need to do for create variables for each value afther/before "|" and each row? something like this:
  $id, $name,....</p>