PHP code example of databowl / databowl-php

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

    

databowl / databowl-php example snippets


/* Create a client, passing the name of the instance to use */
$client = new Databowl\Client('instance-name');
/* Create a new Lead with a campaign ID of 1 and a supplier ID of 5 */
$lead = new Databowl\Leads\Lead(1, 5);

/* Create an array of lead data in the format <fieldName> => <value> */
$data = [
    'f_18_title' => '[title]',
    'f_19_firstname' => '[firstname]',
    'f_20_lastname' => 'Jones',
    'f_17_email' => '[email]',
];

/* Set the lead data */
$lead->getData()->exchangeArray($data);

/* Submit the lead, it returns a new lead */
$newLead = $client->submitLead($lead);

/* Fetch the lead ID and result */
$leadId = $newLead->getLeadId();
$result = $newLead->getResult()->getMessage();
bash
# Install Composer
curl -sS https://getcomposer.org/installer | php
javascript
{
    "l/databowl-php": "0.1.*"
    }
}