PHP code example of zephia / olx

1. Go to this page and download the library: Download zephia/olx 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/ */

    

zephia / olx example snippets




// Instantiate serializer with configurations.
$serializer = \JMS\Serializer\SerializerBuilder::create()
   ->addMetadataDir(__DIR__ . '/resources/config/serializer')
   ->build();

// Generate document feed
$document = new Zephia\OLXFeed\Document($serializer);

// Generate Ad list
$adBag = new \Zephia\OLXFeed\Entity\AdBag;

$document->generate($adBag);

// <?xml version="1.0" encoding="UTF-8"