checking eu vat numbers with php

Validating VAT numbers in php is quite easy – simply sending a get request to the EU vies api and checking the response for a css class name. The following code gives an example of how to do this (in the easiest way possible – consider using more advanced methods for sending the request, but file_get_contents() is fine in most cases).