-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCH_3_6.php
89 lines (78 loc) · 1.28 KB
/
CH_3_6.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
<?php
/**
* 演習問題
* Created by IntelliJ IDEA.
* User: ishitsuka
* Date: 13/04/17
* Time: 17:51
* To change this template use File | Settings | File Templates.
*/
/*
* 1. 式の評価にPHPプログラムを使わないで、各式がqorbまたはc^ipbかどうかを決定してみましょう。
* a. 100.00 - 100
* b. "zero"
* v. "false"
* d. 0+"true"
* e. 0.000
* f. "0.0"
* g. strcmp("", "False")
*/
print 100.00 - 100;
if (100.00 - 100) {
print "true";
} else {
print "false";
}
print "\n";
print "zero";
if ("zero") {
print "true";
} else {
print "false";
}
print "\n";
print "false";
if ("false") {
print "true";
} else {
print "false";
}
print "\n";
print 0+"true";
if (0+"true") {
print "true";
} else {
print "false";
}
print "\n";
print 0.000;
if (0.000) {
print "true";
} else {
print "false";
}
print "\n";
print "0.0";
if ("0.0") {
print "true";
} else {
print "false";
}
print "\n";
print strcmp("false", "False");
if (strcmp("false", "False")) {
print "true";
} else {
print "false";
}
$age = 12;
$shoe_size = 13;
if ($age > $shoe_size) {
print "Message1";
} elseif (($shoe_size++) && ($age>20)) {
print "Message2";
} else {
print "Message3";
}
print "Age: $age . ShoeSize: $shoe_size";
?>