json service from data scraping with php

Posted by fredz0003 on Stack Overflow See other posts from Stack Overflow or by fredz0003
Published on 2012-11-03T15:56:34Z Indexed on 2012/11/03 17:01 UTC
Read the original article Hit count: 203

I am trying to figure out what is the best way to make this work, I am new to php. I was able to make my script work to find specific data on my htm file with the following script tested on my local server.

<?php

include ('simple_html_dom.php');

//create DOM from URL or local file
$html = file_get_html ('Lotto Texas.htm');

//find td class name currLotWinnum and store in variable winNumbers
foreach($html ->find('td.currLotWinnum') as $winNumbers)

    //print winNumbers
    echo "<b>The winning numbers are</b><br>";
    echo $winNumbers -> innertext . '<br>';

?>

Need some light here, ultimately I would like to create a web service to return json format and access that data from my iOS application using NSJSONSerialization class.

© Stack Overflow or respective owner

Related posts about php

Related posts about ios