驗證VAT號碼是否有效的簡易小程式
function checkVAT($vatNumber) { $_vatCountry = strtoupper(substr($vatNumber, 0, 2)); $_vatNumber = substr($vatNumber, 2); $client = new SoapClient("http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl"); $checkRes = $client->checkVat(array( 'countryCode' => $_vatCountry, 'vatNumber' => $_vatNumber )); return $checkRes; }