-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphp_function.php
More file actions
61 lines (61 loc) · 2.74 KB
/
Copy pathphp_function.php
File metadata and controls
61 lines (61 loc) · 2.74 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>:: PHP Function ::</title>
</head>
<body>
<?php
echo"====================is_numberic==============<br>";
$num1 = 1545000;
$num2 = "125000";
$num3 = "Anuchat13";
echo "num1 = ".is_numeric($num1)."<br>";
echo "num2 = ".is_numeric($num2)."<br>";
echo "num3 = ".is_numeric($num3)."<br>";
echo"====================round ciel floor==============<br>";
echo "round 4.7 = ".round(4.7)."<br>";
echo "ceil 4.7 = ".ceil(4.7)."<br>";
echo "floor 4.7 = ".floor(4.7)."<br>";
echo"====================min max==============<br>";
echo "min(4,7,8,3,5,2) = ".min(4,7,8,3,5,2)."<br>";
echo "max(4,7,8,3,5,2) = ".max(4,7,8,3,5,2)."<br>";
echo"====================rand==============<br>";
echo"rand (1, 48) = ".rand(1, 48)."<br>";
echo"====================is_null==============<br>";
$a = null;
echo"is_null(48) = ".is_null($a)."<br>";
echo"====================number_format==============<br>";
$number = 5000;
echo"number_format 5000 = ".number_format($number,2)." บาท<br>";
echo"====================trim==============<br>";
echo"trim = ".trim(" Anuchat ")."<br>";
echo"ltrim = ".trim(" Anuchat")."<br>";
echo"rtrim = ".trim("Anuchat ")."<br>";
echo"====================strtolower,strtoupper==============<br>";
echo"strtolower(ANUCHAT) = ".strtolower("ANUCHAT")."<br>";
echo"strtoupper(anuchat) = ".strtoupper("anuchat")."<br>";
echo"====================substr==============<br>";
$text = "Anuchat Rungsiyanon<br>";
echo"substr(Anuchat Rungsiyanon) = ".substr($text,9,11)."<br>";
echo"====================substr_count==============<br>";
echo"substr_count(Anuchat Rungsiyanon) = ".substr_count($text, "n")."<br>";
echo"====================strlen==============<br>";
echo"strlen(Anuchat Rungsiyanon) = ".strlen($text)."<br>";
echo"====================MD5==============<br>";
$password = 1234;
echo"MD5(1234) = ".md5($password)."<br>";
echo"====================date==============<br>";
echo"date(d-m-y) = ".date('d-m-y')."<br>";
echo"date(d/m/y) = ".date('d/m/y')."<br>";
echo"date(d/m/Y) = ".date('d/m/Y')."<br>";
echo"date(d/m/Y) = ".date('d/m/Y')."<br>";
echo"date(d) = ".date('d')."<br>";
echo"date(m) = ".date('m')."<br>";
echo"date(Y) = ".date('Y')."<br>";
echo"date(Y) = ".date("Y")+543;
?>
</body>
</html>