In PHP, Post and Get data are written into the file. sometimes we don't know the form of Post or Get data, it may be in JSON format or simply submitted data. at this time, we can write the data into the text to see the format of the data.
$ Val = ""; $ currentDateTime = date ('ymdhis ', time (); $ currentDate = date ('ymmd', time ()); $ fileName = "ioslog /". $ currentDate; // file name @ $ data = fopen ($ fileName, 'A + '); // if the file does not exist, the system first checks whether the file exists. if the file does not exist, the file is created, that is, the information of a new file record is created every day $ val. = $ currentDateTime; if ($ _ POST) {$ val. = '| post '. '| '. $ _ POST. "\ n"; foreach ($ _ POST as $ key => $ value) {$ val. = '| '. $ key. ":". $ value ;}} else {$ val. = '| get '. '| '. $ _ GET. "\ n"; foreach ($ _ GET as $ key => $ value) {$ val. = '| '. $ key. ":". $ value ;}}$ val. = "\ n"; fwrite ($ data, $ val); // write the fclose ($ data) in the text );