Php asks two simple questions (jsonphp encryption) 1: I think there are always some of the large website source code such as $ t {& quot; programmers & quot;: [{& quot; firstName & quot;: & quot; Brett & quot;, & quot; lastName & quot;: & quot; McLaughlin & quot;, & quot; email & quot php: two simple questions (json/php encryption)
1: I see that some of the source code of some large websites is always like this.
$ T = {"programmers ":[
{"FirstName": "Brett", "lastName": "McLaughlin", "email": "aaaa "},
{"FirstName": "Jason", "lastName": "Hunter", "email": "bbbb "},
{"FirstName": "Elliotte", "lastName": "Harold", "email": "cccc "}
],
"Authors ":[
{"FirstName": "Isaac", "lastName": "Asimov", "genre": "science fiction "},
{"FirstName": "Tad", "lastName": "Williams", "genre": "fantasy "},
{"FirstName": "Frank", "lastName": "Peretti", "genre": "christian fiction "}
],
"Musicians ":[
{"FirstName": "Eric", "lastName": "Clapton", "instrument": "guitar "},
{"FirstName": "Sergei", "lastName": "Rachmaninoff", "instrument": "piano "}
]}
How can we use the json data? why can we replace all the data without a template? what are the benefits?
2: PHP wants to encrypt two strings
First, how can I handle sessions recognized by users between pages to ensure better security? can I pass the md5 value of a user name and add a number?
The second is to add/gallery/abcdefg12345.jpg next to the URL.
Jpg can be removed statically. what is the addition of the image name?
------ Solution --------------------
1. it is a common json string. what do you mean by json_encode and json_decode.
2. First, the SESSION is on the server, which is inherently safe. 2. can I rewrite it, but does it make sense? who will rewrite static images?
------ Solution --------------------
Google: json database.
------ Solution --------------------
There are only a few types of encryption. you can just look at the useful ones. advanced encryption involves keys:
PHP code
$ Str1 = "abcabc123123"; // add a pure number or a pure letter $ str2 = "I am a Chinese"; // is this statement equally valid? echo md5 ($ str1 )."
"; # 8709a6a92a8d441868d916b9ea2c07c2echo md5 ($ str2 )."
"; # 512d1643ba2878bc9c9f8f4fda-673dfecho urlencode ($ str1 )."
"; # Abcabc123123echo urlencode ($ str2 )."
"; # % E6 % 88% 91% E6 % 98% AF % E4 % B8 % AD % E5 % 9B % BD % E4 % BA % BAecho base64_encode ($ str1 )."
"; # YWJjYWJjMTIzMTIzecho base64_encode ($ str2 )."
"; #5oiR5piv5Lit5Zu95Lq6