php - need specific data from a url with file_get_contents () -
i trying read url file_get_contents(). need $invoice page.
$invoice appears on sentence following example number 789621 :
<code><div class="show invoice invoice_number_rajhi"><a href="/fatora/alrajhi/invoices/3687908533/people" class="link-blue" onclick="$.fn.colorbox({title:"people visit this",oncomplete:show.onpeopleopening,oncleanup:show.onpeopleclosing,href:"/fatora/alrajhi/invoices/3687908533/people"}); return false">789621 paid</a> show this</div></code> and if appears following example , how ?
<code><li class="js-stat-show js-stat-show stat-still"> <a href="#" class="request-invoice-popup" data-activity-popup-title="invoice 789621 paid" > paid <strong>789621</strong> </a> </li></code>
using regular expressions in php:
$myurl = "theurlyouwant"; preg_match("/return false\"\>(.*?) paid/i", file_get_contents($myurl), $matches); $invoice = $matches[1]; echo($invoice); now, variable $invoice should equal invoice number
Comments
Post a Comment