PHP code example of adecks / trafficza

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

    

adecks / trafficza example snippets



// Interacting with the iTraffic API
use Adecks\TrafficZA\Traffic;

public function getTrafficEvents() {

	$traffic = new Traffic('YOUR_API_KEY');
	
	$events = $traffic->getEvents();

	foreach($events as $event) {
		$event->getReported();
	}
}


Adecks\TrafficZA\Alert::class
Adecks\TrafficZA\Camera::class
Adecks\TrafficZA\Event::class
Adecks\TrafficZA\MessageSign::class
Adecks\TrafficZA\Roadway::class