vehicle-registration
文件大小: unknow
源码售价: 5 个金币 积分规则     积分充值
资源说明:PHP Class that can determine which era, year and location of a Vehicle Registration
vehicle-registration
====================

PHP Class that can determine which era, year and location of a Vehicle Registration. Currently it verifies UK Vehicle Registrations, however the plan is to extend it in the future. All data used has been researched from http://en.wikipedia.org/wiki/Vehicle_registration_plates_of_the_United_Kingdom and http://www.cvpg.co.uk/REG.pdf

Warning: The classes contain an EXTREME number of Regular Expressions, I apologise profusely :)

Example usage
-------------

    verifyRegistration('EX12 CFG');

    // If no error, proceeed
    $error = $verifyRegistration->getErrorMessage();
    if ($error === false)  {
        // Display the period from when the Vehicle was registered
        echo 'Period: ' . $verifyRegistration->getPeriod();

        // Display any specific information about the vehicle registration
        $metaData = $verifyRegistration->getMetaData();
        if ($metaData->isException()) {
            echo 'Exception Details: ' . $metaData->getException();
        }

        // Display the location of where the vehicle was registered
        if ($metaData->locationKnown()) {
            echo 'Location of Registration: ' . $metaData->getLocation();
        }

        // Display the dates that the vehicle was most likely registered between
        if ($metaData->datesKnown()) {
            echo 'Car registered between: "' . $metaData->getStartDate() . '"" and "' . $metaData->getEndDate() . '"';
        }

    } else {
        // Display the error that occurred
        echo "Error: {$error}";
    } ?>

本源码包内暂不包含可直接显示的源代码文件,请下载源码包。