PHP Classes

File: app/api/numberOfUsersPerCountry.php

Recommend this page to a friend!
  Classes of Faris AL-Otabi   PHP IP Logger   app/api/numberOfUsersPerCountry.php   Download  
File: app/api/numberOfUsersPerCountry.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP IP Logger
Track user IP addresses that access certain pages
Author: By
Last change:
Date: 1 year ago
Size: 565 bytes
 

Contents

Class file image Download
<?php

header
("Content-Type: application/json");
require_once
'../config/config.php';

$utils = new Framework\Utils();

$database = new Framework\Database($config);

$logger = new Framework\Logger($database, $utils);

$client = new Framework\Client($database, $utils);

$countries = $utils->getCountries();
$arrays = [];
foreach (
$countries as $data => $value) {
   
array_push(
       
$arrays,
        [
           
"id" => $data,
           
"value" => $client->countClientsByCond("country", $data)
        ]
    );
}
echo
json_encode(["countries" => $arrays]);