PHP Classes

File: examples/plain/people.php

Recommend this page to a friend!
  Packages of Boss Ibrahim Mussa   Caelrik   examples/plain/people.php   Download  
File: examples/plain/people.php
Role: Auxiliary script
Content type: text/plain
Description: Configuration script
Class: Caelrik
Build Web user interface from PHP components
Author: By
Last change:
Date: 8 days ago
Size: 645 bytes
 

 

Contents

Class file image Download
<?php

declare(strict_types=1);

$first = ['Ada', 'Alan', 'Grace', 'Linus', 'Margaret', 'Dennis', 'Barbara', 'Ken', 'Frances', 'Tim'];
$last = [
    'Lovelace', 'Turing', 'Hopper', 'Torvalds', 'Hamilton', 'Ritchie', 'Liskov', 'Thompson', 'Allen', 'Berners-Lee',
];
$cities = ['Paris', 'London', 'Montreal', 'Berlin', 'Dakar'];

$people = [];
for ($i = 1; $i <= 250; $i++) {
    $name = $first[$i % 10] . ' ' . $last[intdiv($i, 10) % 10];
    $people[] = [
        'id' => $i,
        'name' => $name,
        'email' => strtolower(str_replace(' ', '.', $name)) . $i . '@example.com',
        'city' => $cities[$i % 5],
    ];
}

return $people;