Advertisement
Guest User

Wolfpack08

a guest
Jan 1st, 2012
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.58 KB | None | 0 0
  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. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement