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
| function calculate(x){ | |
| let y = x.length | |
| if(y > 1){ | |
| return 1 | |
| } | |
| else if(y > 2){ | |
| return 2 | |
| } |
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 | |
| $people = '{"data":[{"first_name":"jake","last_name":"bennett","age":31,"email":"jake@bennett.com","secret":"VXNlIHRoaXMgc2VjcmV0IHBocmFzZSBzb21ld2hlcmUgaW4geW91ciBjb2RlJ3MgY29tbWVudHM="},{"first_name":"jordon","last_name":"brill","age":85,"email": "jordon@brill.com","secret":"YWxidXF1ZXJxdWUuIHNub3JrZWwu"},]}'; | |
| //Engage "Super Secret Spy Award" ;) | |
| //Trim off the "," at the end of the JSON that is preventing us from decoding, without directly manipulating the source | |
| $people[-3] = " "; | |
| //Decode JSON to something we can work with | |
| $tempArray = json_decode($people, true); |