๐
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Class Simple_Json_Api | |
| */ | |
| class Simple_Json_Api { | |
| /** | |
| * The top level argument for the endpoint. | |
| * ex http://example.com/myjson/post/1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * This function get a nested array and return flatten format of that array | |
| */ | |
| function flatten(array) { | |
| var flat = []; | |
| for(var i = 0; i < array.length; i++) { | |
| if(Array.isArray(array[i])) { | |
| flat = flat.concat(flatten(array[i])); | |
| } else { | |
| flat.push(array[i]); |
NewerOlder