-
Notifications
You must be signed in to change notification settings - Fork 4
/
functions.php
48 lines (40 loc) · 1.82 KB
/
functions.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
<?php
/**
* ————————————————————————————————————————————————————————————————————————————————
* WEBTIGERS Copyright Notice
* ————————————————————————————————————————————————————————————————————————————————
*
* Copyright © 2020 WebTigers
* All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains the property of WebTigers.
* The intellectual and technical concepts contained herein are proprietary to
* WebTigers and may be covered by U.S. and Foreign Patents, patents in process, and
* are protected by trade secret or copyright law. Dissemination of this information
* or reproduction of this material is strictly forbidden unless prior written
* permission is obtained from WebTigers.
*
* See the LICENSE.txt for full licensing information governing the use of this
* information and software.
*/
/** Quick var print functions for debugging. */
function pr ($var, $die = true) {
header("Content-Type:text/plain");
if ($die) { die(print_r($var,1)); } else { print_r($var,1); }
}
/** Zend var print functions for debugging. */
function zd ($var, $die = true) {
if ($die) { die(Zend_Debug::dump($var)); } else { Zend_Debug::dump($var); }
}
/** Function to test and return JSON data. */
function is_json( $string, $return_data = false ) {
if ( ! is_string( $string ) ){
return false;
}
$data = json_decode( $string );
return ( json_last_error() === JSON_ERROR_NONE )
? ( $return_data )
? $data
: true
: false;
}