hi, I guess this is very hard question . How to grabe content information from other website,divide it and insert into databse.
let say, a website has a page like this pattern
Volume 5, Book 58, Number 120:
Narrated Ghailan bin Jarir:
sometextsometextsometextsometextsometextsometextsometextsometextsometextsometextsometextsometextsometext
Volume 6, Book 5, Number 10:
Narrated dude:
What do you think about php
Php is cool,
somtext goes heresomtext goes heresomtext goes heresomtext goes here
and so on ....(repeated words are volume,Book,Number,narrated and <hr> )
What I want is to grabe this information and insert into a table which has the following fields
volume,book,number,narrator,text
ie,
voume=6
book=5
number=1o
narator=dude
text=
What do you think about php
Php is cool,
somtext goes heresomtext goes heresomtext goes heresomtext goes here
text filed can have pagebreak or line break code.
here is my attempt
<?php
$GrabURL = "http://www.ccccc.html";
$GrabStart = '</h1>';
$GrabEnd = '<!--Footer-->';
$OpenFile = fopen("$GrabURL", "r");
$RetrieveFile = fread($OpenFile, 200000);
$GrabData = eregi("$GrabStart(.*)$GrabEnd", $RetrieveFile, $DataPrint);
$DataPrint[1] = str_replace("<hr>", "", $DataPrint[1]);
fclose($OpenFile);
echo $DataPrint[1];
?>
Any help ?