PHP code example of seanmcn / php-represent
1. Go to this page and download the library: Download seanmcn/php-represent 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/ */
seanmcn / php-represent example snippets
$represent = new PHPRepresent\API();
$path = 'boundaries';
$params = ['sets' => ['toronto-wards', 'ottawa-wards']];
$represent->get($path, $params);
$represent = new PHPRepresent\API();
$path = 'boundaries';
$params = ['sets' => 'toronto-wards,ottawa-wards'];
$represent->getAll($path, $params);
$represent = new PHPRepresent\API();
$represent->postcode('L5G4L3');
$represent = new PHPRepresent\API();
$represent->boundarySets();
$represent = new PHPRepresent\API();
// One Set
$represent->boundaries('toronto-wards');
// Multiple Sets
$represent->boundaries(null, null, false, ['sets' => ['toronto-wards', 'ottawa-wards']]);
$represent = new PHPRepresent\API();
$represent->representativeSets('north-dumfries-township-council');
$represent = new PHPRepresent\API();
$represent->representatives('house-of-commons');
$represent = new PHPRepresent\API();
$represent->elections();
$represent = new PHPRepresent\API();
$represent->candidates();
$represent = new PHPRepresent\API();
$represent->setInsecure();
$represent->boundaries('toronto-wards');
$represent = new PHPRepresent\API();
$represent->setRateLimit(42);
$represent->boundaries('ottawa-wards');
" "seanmcn/php-represent": "1.*"
}
$represent = new PHPRepresent\API();
$represent->getAll('boundaries', ['sets' => ['toronto-wards', 'ottawa-wards']]);