NP Tracker server API example
Overview
Using the NPS API
Parameters
Other APIs
Advanced
Get access token
php Example
php code example
") !== false) { $reply = str_replace('$>', "", $reply); return $reply; } } return 0; } $socket = fsockopen("serv.nptracker.co.za", "40", $errno, $errstr); if($socket) { echo "Connected."; } else { echo "Connection failed!"; return; } echo service_reply($socket); //Display welcome test fputs($socket, "AUTH $token\n"); //Authorize the user echo service_reply($socket); //Display authenticated text foreach ($arr as &$plate){ echo "Testing plate [$plate]\n"; fputs($socket, "test $plate\n"); //test plate if (strpos(service_reply($socket), ': true') !== false) { fputs($socket, "nps $plate\n"); //Get report for plate echo service_reply($socket); } } fputs($socket, "exit\n"); //Send the exit command fclose($socket); //Close connection to server ?>