-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunction.php
More file actions
57 lines (39 loc) · 754 Bytes
/
function.php
File metadata and controls
57 lines (39 loc) · 754 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
function base_path($file)
{
return BASE_PATH . $file;
}
function urlIs($value)
{
return $_SERVER["REQUEST_URI"] == $value;
}
function dd($value)
{
echo "<pre/>";
var_dump($value);
echo "<pre/>";
}
// function login($user)
// {
// $_SESSION["user"] = $user;
// }
function view($path, $options = [])
{
extract($options);
return base_path('view/' . $path);
}
function controller($path, $options = [])
{
extract($options);
return base_path('controller/' . $path);
}
function getpassword($count)
{
$char = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ!#$%&*+';
$randString = "";
for ($i = 0; $i < $count; $i++) {
$index = rand(0, strlen($char) - 1);
$randString .= $char[$index];
}
return $randString;
}