Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/458.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/256.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我需要使用javascript对象将表中的记录作为每一行插入?_Javascript_Php_Object - Fatal编程技术网

我需要使用javascript对象将表中的记录作为每一行插入?

我需要使用javascript对象将表中的记录作为每一行插入?,javascript,php,object,Javascript,Php,Object,我的对象有白天时段的详细信息,比如从_时间到_时间。我必须在表中的新行中添加每个条目。但无法使用当前接收对象形成数组。我的目标如下: { Fri : ( { "from_time" : "7:00 AM"; "to_time" : "8:00 AM"; }, { "from_time" : "8:00 AM"; "to_time" : "10:00 AM"; }, { "from_time" : "2

我的对象有白天时段的详细信息,比如从_时间到_时间。我必须在表中的新行中添加每个条目。但无法使用当前接收对象形成数组。我的目标如下:

    {
    Fri : (
    {
    "from_time" : "7:00 AM";
    "to_time" : "8:00 AM";
    },
    {
    "from_time" : "8:00 AM";
    "to_time" : "10:00 AM";
    },
    {
    "from_time" : "2:00 PM";
    "to_time" : "4:00 PM";
    }
    );
    Mon : (
    {
    "from_time" : "12:00 PM";
    "to_time" : "1:00 PM";
    },
    {
    "from_time" : "1:00 PM";
    "to_time" : "10:00 AM";
    },
    {
    "from_time" : "1:00 PM";
    "to_time" : "7:00 AM";
    }
    );
    Sat : (
    {
    "from_time" : "8:00 AM";
    "to_time" : "7:00 AM";
    },
    {
    "from_time" : "1:00 PM";
    "to_time" : "1:00 PM";
    },
    {
    "from_time" : "5:00 PM";
    "to_time" : "2:00 PM";
    }
    );
    Sun : (
    {
    "from_time" : "3:00 PM";
    "to_time" : "5:00 PM";
    },
    {
    "from_time" : "4:00 PM";
    "to_time" : "4:00 PM";
    },
    {
    "from_time" : "5:00 PM";
    "to_time" : "3:00 PM";
    }
    );
    Thu : (
    {
    "from_time" : "7:00 AM";
    "to_time" : "8:00 AM";
    },
    {
    "from_time" : "12:00 PM";
    "to_time" : "2:00 PM";
    },
    {
    "from_time" : "2:00 PM";
    "to_time" : "3:00 PM";
    }
    );
    Tue : (
    {
    "from_time" : "10:00 AM";
    "to_time" : "10:00 AM";
    },
    {
    "from_time" : "2:00 PM";
    "to_time" : "1:00 PM";
    },
    {
    "from_time" : "6:00 PM";
    "to_time" : "3:00 PM";
    }
    );
    Wed : (
    {
    "from_time" : "11:00 AM";
    "to_time" : "11:00 AM";
    },
    {
    "from_time" : "12:00 PM";
    "to_time" : "2:00 PM";
    },
    {
    "from_time" : "4:00 PM";
    "to_time" : "4:00 PM";
    }
    );
    }
因为我在php中尝试了很多方法来获取该对象,但代码无法正确读取该对象。使用foreach逐个插入记录。
我需要在表行中插入条目,如Fri 12:00 PM 04:00 PM。

能否显示您尝试的内容?因此,您需要一个数组,如
[“Fri 07:00AM 08:00AM”,Fri 12:00PM 04:00PM,…]
?您所称的“对象”在任何方面都不是对象。你能改变它的构造方式吗?