我想知道这个字符串是如何制作的
[{"status":"open","open_time":"0900","close_time":"2100"},{"status":"open","open_time":"0730","close_time":"2100"},{"status":"open","open_time":"0730","close_time":"2100"},{"status":"open","open_time":"0730","close_time":"2100"},{"status":"open","open_time":"0730","close_time":"2100"},{"status":"open","open_time":"0730","close_time":"2100"},{"status":"open","open_time":"0900","close_time":"2100"}]`
有一个复选框,如果选中打开,要么关闭,然后 2 个文本字段,您可以分别输入打开时间和关闭时间。单击提交按钮后,数据库将保存此字符串。谁能让我明白这一点?顺便说一句,它在代码点火器中。
创建一个数组,并使用json_encode函数
$arr = array('lorem' => 'ipsum');
$json = json_encode($arr);
如果它首先来自表单,你会看到方法,如果它的GET或POST。
$string = json_encode($_POST);
$string1 = json_encode($_GET);