PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Martin Dahl-Larsen   EU VAT Checker   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example / test
Class: EU VAT Checker
Validate European Union VAT numbers
Author: By
Last change:
Date: 14 years ago
Size: 483 bytes
 

Contents

Class file image Download
<?php
require_once("euvatchecker_class.php");
$vat = new EUVATChecker("data_vat.xml", "error_vat.xml", "ok_vat.xml", "dk");

#OK $vatno = "DK28 61 53 37";
#NO OK $vatno = "DK26 61 53 37";

$vatno = "DK28 61 53 37";



if(
$vat->check($vatno)){

   
//RETURNS THE OK TXT
   
echo $vat->getResult();
   
    echo
" : ";
   
   
//RETURNS THE COUNTRY
   
echo ucfirst($vat->getPays($vatno));
   

}else{
   
//RETURS THE ERROR TXT
   
echo $vat->getLastError();
 
};
?>