Array
(
[0] => stdClass Object
(
[wts_id] => 47
[wts_place_id] => 103
[wts_start_date] => 2015-08-13
[wts_end_date] => 2015-08-13
[wts_start_time] => 12:00:00
[wts_end_time] => 15:00:00
[wts_day_off] => 0
[wts_updated_on] => 2015-07-29 09:52:40
)
[1] => stdClass Object
(
[wts_id] => 48
[wts_place_id] => 103
[wts_start_date] => 2015-08-13
[wts_end_date] => 2015-08-13
[wts_start_time] => 19:00:00
[wts_end_time] => 22:00:00
[wts_day_off] => 0
[wts_updated_on] => 2015-07-29 09:53:00
)
)
我需要将wts_start_Time和wts_end_time附加到带有||的变量它们每个对象元素值都不同。
答案 0 :(得分:0)
这将使用wts_start_Time-wts_end_time创建数组$ time并将该数组与“||”连接
for($k=0; $k<count($query3); $k++)
{
$time[$k] = $query3[$k]->wts_start_time."-".$query3[$k]->wts_end_time;
}
echo $final_value = implode("||", $time);