forked from hetao29/slightphp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSJson.php
More file actions
43 lines (40 loc) · 1.35 KB
/
Copy pathSJson.php
File metadata and controls
43 lines (40 loc) · 1.35 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
<?php
/*{{{LICENSE
+-----------------------------------------------------------------------+
| SlightPHP Framework |
+-----------------------------------------------------------------------+
| This program is free software; you can redistribute it and/or modify |
| it under the terms of the GNU General Public License as published by |
| the Free Software Foundation. You should have received a copy of the |
| GNU General Public License along with this program. If not, see |
| http://www.gnu.org/licenses/. |
| Copyright (C) 2008-2009. All Rights Reserved. |
+-----------------------------------------------------------------------+
| Supports: http://www.slightphp.com |
+-----------------------------------------------------------------------+
}}}*/
/**
* @package SlightPHP
*/
class SJson{
/**
* encode object to json
*
* @param mixed $object
* @return string json
* @access public
*/
public static function encode($object,$options = 0){
return json_encode($object, $options);
}
/**
* decode string to json object
*
* @param string $str
* @return mixed object
* @access public
*/
public static function decode($str, $options = 0){
return json_decode($str,$options);
}
}