On Mon, Apr 08, 2002 at 06:32:42PM -0400, Christopher J. Crane wrote:

> $file =
> "http://quotes.nasdaq.com/quote.dll?page=xml&mode=stock&symbol=$sym";;
... snip ...
> while ($data = fread($fp, 4096)) {
>  if (!xml_parse($xml_parser, $data, feof($fp))) {
... snip ...

You've got a whole series of unneded steps and functions.  More
importantly, you're sending the file to the parser line by line.  You
need to send the whole file to the parser in one shot.

   $Contents = implode( '', file($file) );
   if ( xml_parse($xml_parser, $Contents) ) {
      # Life is good!
   }

Enjoy,

--Dan

-- 
              PHP scripts that make web design easier
        SQL Solution  |   Layout Solution   |  Form Solution
    sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Ave, Brooklyn NY 11232    v: 718-854-0335    f: 718-854-0409

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to