-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathusersmain.php
More file actions
33 lines (27 loc) · 904 Bytes
/
usersmain.php
File metadata and controls
33 lines (27 loc) · 904 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
<div id="contentarea" class="clearfix">
<p><?php echo $this->getUsername(); ?></p>
<p><?php echo $this->getEmail(); ?></p>
<p><?php echo $this->getMemtype(); ?></p>
<?php
class Emp {
public $name = "";
public $hobbies = "";
public $birthdate = "";
public function __toString() {
$str = "My name is {$name}";
$str .= "My hobbies are {$hobbies}";
$str .= "My birthdate is {$birthdate}";
}
}
$e = new Emp();
$e->name = "sachin";
$e->hobbies = "sports";
$e->birthdate = date('m/d/Y h:i:s a', "8/5/1974 12:20:03 p");
$e->birthdate = date('m/d/Y h:i:s a', strtotime("8/5/1974 12:20:03"));
$json = json_encode($e);
echo "Jason encode" . $json;
$out = new Emp();
$out = json_decode($json);
echo serialize($out);
?>
</div><!--end contentarea -->