This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Wolfpack08

By: a guest on Jan 1st, 2012  |  syntax: PHP  |  size: 0.58 KB  |  views: 58  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2.  
  3. $filename = "fakexample.txt";
  4. $file = fopen($filename, "rb");
  5. $myFile = fread($file, filesize($filename));
  6. $string = ":(";
  7.  
  8. function exclude_lines($exclude, $file){
  9.   foreach(preg_split("/(\r?\n)/", $file) as $line){
  10.     if(strpos($line,$exclude[0]) === false && strpos($line,$exclude[1]) === false)
  11.       preg_match_all('/([^,]+)/', $line, $tokens);
  12.  
  13. $mytokes = var_dump($tokens);
  14. echo $mytokes;
  15.      
  16.    
  17.   }
  18.   return $tokens;
  19. }
  20.  
  21.  
  22. exclude_lines($string, $myFile);
  23.  
  24. $output = exclude_lines($string, $myFile);
  25. foreach($output as $output){
  26.   echo $output;
  27. }
  28.  
  29. ?>
clone this paste RAW Paste Data