-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathsample.source.php
More file actions
131 lines (118 loc) · 1.81 KB
/
sample.source.php
File metadata and controls
131 lines (118 loc) · 1.81 KB
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
/*
more
than
one
line
comment
*/
// single line comment
# a different single line comment
$foo = 'a string'
$foo2 = "a string"
//$foo = 'a string'
//$foo2 = "a string"
$foo3 = "a string" // a comment
/* Incorrect Method: */
if($a > $b):
echo $a." is greater than ".$b;
else if($a == $b): // Will not compile.
echo "The above line causes a parse error.";
endif;
/* Correct Method: */
if($a > $b):
echo $a." is greater than ".$b;
elseif($a == $b): // Note the combination of the words.
echo $a." equals ".$b;
else:
echo $a." is neither greater than or equal to ".$b;
endif;
<?php
$file = fopen("welcome.txt", "r") or exit("Unable to open file!");
//Output a line of the file until the end is reached
/* single line comment */
echo "<table width=\"175\" border=\"1\" class=\"Table1\">\n";
$regex = '/(?:(")|(?:\'))((?(1)[^"]+|[^\']+))(?(1)"|\')/';
while(!feof($file))
{
echo fgets($file). "<br />";
/* single line comment */
}
/*multi line style
* Second line
* third line
* fourth line
*/
fclose($file);
mysqli_fetch_object())
and
__LINE__
class
die()
empty()
endswitch
for
include()
print()
switch
__FUNCTION__
interface
protected
throw
or
array()
const
do
enddeclare
endwhile
foreach
include_once()
require()
unset()
__CLASS__
implements
abstract
cfunction
namespace
xor
as
continue
echo()
endfor
eval()
function
isset()
require_once()
use
__METHOD__
clone
old_function
goto
__FILE__
break
declare
else
endforeach
exit()
global
list()
return()
var
final
public
try
this
exception
case
default
elseif
endif
extends
if
new
static
while
php_user_filter
private
catch
final
?>