PhP curl simple_dom_document request to get snow data from snowbird.com PhP curl simple_dom_document request to get snow data from snowbird.com curl curl

PhP curl simple_dom_document request to get snow data from snowbird.com


Do note that the html markup you're getting has multiple instances of .total-inches (multiple nodes with this class). If you want to explicitly get one, you can point to it directly using the second argument of ->find().

Example:

$ret2 = $html->find('.total-inches', 3);                                   // ^

If you want to check them all out, a simple foreach should suffice:

foreach($html->find('.current-conditions .snowfall-total .total-inches') as $in) {    echo $in , "\n";}