PHP code example of ahhp / vast

1. Go to this page and download the library: Download ahhp/vast library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ahhp / vast example snippets


$vast = new ahhp\Vast\Vast();
$vast->addAd(
    (new \ahhp\Vast\Nodes\Ad)
        ->setInLine(
            (new \ahhp\Vast\Nodes\InLine)
                ->setAdServingId("ad-servering-id")
                ->addCategory("authority1", "uri1")
                ->addCategory("authority2", "uri2")
        )
);
echo $vast->getXML();