-
Notifications
You must be signed in to change notification settings - Fork 0
/
form-test.php
113 lines (100 loc) · 2.22 KB
/
form-test.php
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<?php
/*// print_r($_GET);
echo _LINE_;
echo _FILE_;
echo _DIR_;
echo _FUNCTION_;
echo _CLASS_;
echo _METHOD_;
*/
echo "Hello World";
echo "</br>";
function longdate($timestamp){
return date("F jS Y",$timestamp);
}
echo longdate(time());
echo "</br>";
//7days ago
echo longdate(time()-7*24*60*60);
echo "</br>";
echo "a:[".(20>9)."]<br/>";
echo "b:[".(5==6)."]<br/>";
//function
echo fix_names("WILLIAM","henry","gatES");
echo "</br>";
function fix_names($n1,$n2,$n3){
$n1=ucfirst(strtolower($n1));
$n2=ucfirst(strtolower($n2));
$n3=ucfirst(strtolower($n3));
return $n1." ".$n2." ".$n3;
}
echo phpversion();
echo "</br>";
$object=new User;
print_r($object);echo "<br/>";
$object->name="Joe";
$object->password="mypass";
print_r($object);echo "<br/>";
$object->save_user();
class User{
public $name,$password;
function save_user(){
echo "Save User code goes here";
}
}
$temp=new Test();
echo "Test A: ".Test::$static_property."<br/>";
echo "Test B: ".$temp->get_sp()."<br/>";
echo "Test C: ".$temp->static_property."<br/>" ;
class Test{
static $static_property="I am static";
function get_sp(){
return self::$static_property;
}
}
$object1=new Subscriber;
$object1->name="Kelvin";
$object1->password="Password";
$object1->phone="010 203902929";
$object1->email="0101010@qq.com";
$object1->display();
class User1{
public $name,$password;
function save_user(){
echo "Save User code goes here.";
}
}
class Subscriber extends User{
public $phone,$email;
function display(){
echo "Name : ".$this->name."<br/>";
echo "Pass : ".$this->password."<br/>";
echo "Phone : ".$this->phone."<br/>";
echo "Email : ".$this->email."<br/>";
}
}
$object2=new Tiger();
echo "Tigers have...<br/>";
echo "Fur : ".$object2->fur."<br/>";
echo "stripes : ".$object2->stripes."<br/>";
class Wildcat{
public $fur;
function __construct(){
$this->fur="TRUE";
}
}
class Tiger extends Wildcat{
public $stripes;
function __construct(){
parent::__construct();
$this->stripes="TRUE";
}
}
printf("<font color='#%X%X%X'>Hello</font>",64,127,255);
echo "<br/>";
if(file_exists("filetest.txt")){
echo "File exits";
}else{
echo "File does not exits";
}
?>