I'll start with using DOM parsing is new to me but I've been working with it the last few days. Any help is appreciated.
My objective is to pull a number that sits between any span with an id=numbers (plus some additional info I don't care about). Here's the code I'm using for that portion:
$html = file_get_html($url);
foreach($html->find('span[id*=numbers]') as $key => $info)
{ echo ($key + 1).'. '.$info->plaintext."<br />\n";
$numbers[$key+1]=$info; }
In the for loop when echo each entry I see the numbers I'm suppose to.
However, the issue I'm having now is setting up the data properly in a way that it can be transferred into the database "numbersdata" that's already been set up. $numbers , in the above code, doesn't work.
$sql="INSERT INTO numbersdata VALUES ('$numbers')";
$result = mysql_query($sql);
//I'm connected to my DB already.
I have 50 numbers and each number needs to placed into the corresponding field in the database.
I know it's probably something simple I'm overlooking but if anyone has some suggestions or ideas that would be great.
Thanks