-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathaction.php
More file actions
36 lines (36 loc) · 952 Bytes
/
action.php
File metadata and controls
36 lines (36 loc) · 952 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
34
35
36
<?php
//---------poo---------------------------------
class Action{
const CITY="LSHI";
public $nom;
public $address;
public $heurdeb;
public $heurfin;
public function info(){
echo "Info par rapport au visite";
$now=getdate();
$hour=$now['hours'];
$jour=$now['wday'];
if(($hour>=$this->heurdeb)&&($hour<=$this->heurfin)){
echo "<br/>L'hopital est ouvert!";
}
else{
echo "<br/>L'hopital est ferme";
echo '<br/>'.$hour.'<br/>'.$jour;
}
}
}
//nom de la class
$maclass="Action";
$hospital=new $maclass();
$hospital->nom="Sendwe";
$hospital->address="123.Av sendwe Q.makomeno C.L'shi";
$hospital->heurdeb=21;
$hospital->heurfin=24;
$hospital->info();echo '<br/>';
var_dump($hospital);
$str=gettype($hospital);
//verifie si $hospital est une instance de $maclass
if(!($hospital instanceof $maclass)){
echo '<br/>Ok';
}