Scraping HTML from Websites with PHP
January 13, 2013 — 21:06

Here’s a simple and useful PHP script that i’ve used a number of times to pull data from an external site to use elsewhere. I first used it with my¬†android app. To minimise data use on the phone the entered reg number is sent to one of my webservers which requests the site, submitting the given reg and returning just the vehicle information.

The phone requests¬†server/file.php?registration=<reg number> Where the registration number is first read into the variable ‘reg’

$reg = $_REQUEST['registration'];