Spaces Not Detected from Regular Expression preg_match

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, 

  I have a code as in the following:

<?php

    $file = "test.txt";
    $fp = fopen($file, "r");

   while(!feof($fp)) {
   $data = fgets($fp, 1024);
   
   if ((preg_match("/0/",$data)) || 
      (preg_match("/\"\s\"/",$data)) || 
      (preg_match("/\"\s\"/",$data))) {
         //Don't do a thing
   }
 
} 
    fclose($fp);

?>


This is the input file:

1
23kd
3dkd2
" "
4
5
6

For the output, I get nothing running it from the command prompt, but I would like to have " " in the output, 
could anyone please give me some guides on what I have done wrong in my regular expression?

Thanks for your help.

Alice






_________________________________________________________________
Search from any Web page with powerful protection. Get the FREE Windows Live Toolbar Today!
http://get.live.com/toolbar/overview

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux