MySQL Forums
Forum List  »  PHP

Re: How do I pull out data from a mySQL DB...
Posted by: Peter Brawley
Date: April 25, 2006 08:32AM

Then debug it. For reference purposes, here's a tested example which extracts the word or phrase between "If you use" and ", you need this ebook".

$url = "http://www.artfulsoftware.com";;
$lines = file( $url );
$val = "Not found";
foreach( $lines as $l => $line ) {
$i = strpos( $line, "If you use" );
if( $i > 0 ) {
$j = strpos( $line, ", you need" );
$val = substr( $line, $i+10, $j-$i-10 );
break;
}
}
echo $val;

PB

Options: ReplyQuote


Subject
Written By
Posted
Re: How do I pull out data from a mySQL DB...
April 25, 2006 08:32AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.