-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathglobals.php
More file actions
44 lines (39 loc) · 778 Bytes
/
globals.php
File metadata and controls
44 lines (39 loc) · 778 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
<?php
/**
* returns true if isset() is true, and the value is true
*/
function isset_true(&$data)
{
return (isset($data) && $data);
}
/**
* returns the value if isset(), otherwise returns false.
*/
function isset_val(&$data)
{
return ((isset($data) && $data) ? $data : false);
}
/**
* If the value is set, returns the value. Else, returns default.
* @param unknown_type $data
* @param unknown_type $default
*/
function isset_default(&$data, $default)
{
return (isset($data) ? $data : $default);
}
/**
* print_r's an array, wrapped in <pre> tags.
*/
function print_r_pre($array)
{
print '<pre>'.print_r($array,true).'</pre>';
}
/**
* print_r's an array, wrapped in <pre> tags, then dies.
*/
function print_r_pre_die($array)
{
print_r_pre($array);
die();
}