Re: Re: Searching and removing

From: Date: Thu, 29 Jul 2004 23:58:31 +0000
Subject: Re: Re: Searching and removing
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-192260@lists.php.net to get a copy of this message
On Thu, 29 Jul 2004 23:25:41 +0000 (UTC), Jonathan Lassoff <jlassoff@gmail.com> wrote: > Justin Patrin <papercrane <at> gmail.com> writes: > > Assuming there's only one table in the document.... > > > > preg_match('!<table[^>]*>.*</table>!i', $text, $matches); > > $table = $matches[0]; > > Thanks! I thought that I was putting it into a variable, but poking around with > the script, it actually is just pooping out all the fetched data without putting > it into a variable. I can't really find documentation on some of the curl > functions, and I was wondering if you could provide some insight. Here is the > source: > > <HTML> > <BODY> > <?php > $ch = > curl_init("http://www.infinitysf.com/beta/music/subsonic/default.asp"); > curl_setopt($ch, CURLOPT_FILE, $fp); You're not defining $fp before here, so it is unset. This probably just tells curl to output to STDOUT. > curl_setopt($ch, CURLOPT_HEADER, 0); > curl_exec($ch); > curl_close($ch); > #I thought I was echoing the variable here, but it shows it without this.-> > echo($fp); This doesn't echo anything as $fp is not defined anywhere above. > ?> > </BODY> > </HTML> > You could "fix" this script by actually giving it a file to output to and reading it or by using output buffering to grab the output into a string. Or you could use some code which gives you a better interface for all of this, such as: http://pear.php.net/package/HTTP_Request -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin--

« previous php.general (#192260) next »