-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOOP.php
More file actions
33 lines (30 loc) · 701 Bytes
/
OOP.php
File metadata and controls
33 lines (30 loc) · 701 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
class osoba{
public $wiek;
public $imie;
public $id;
function new($wiek, $imie, $id){
$this ->imie.readline("Podaj imie: ");
$this ->wiek.readline("Podaj wiek: ");
$this ->id = $id;
}
function get(){
$this -> id;
}
}
$db = [];
$id = 0 ;
for(;;){
echo "Menu:\n";
echo "1: Dodanie nowej osoby \n";
echo "2: Wyświetlnanie Data base\n";
echo "5:koniec\n";
$userinput = readline("co wykonać: ");
switch($userinput){
case 1:
$os.$id = readline("kogo dodać:");
$os.$id = new osoba();
$i++;
break;
}
}