【发布时间】:2016-07-14 06:24:13
【问题描述】:
我需要创建 html 表格...
使用此代码:
$result = curl_exec($ch);
curl_close($ch);
$json = json_decode($result);
foreach ($json->data->reservations as $element) {
print_r($element);
}//
我得到了这个数据:
stdClass Object ( [id] => 11616946 [property] => NNN [propertyName] => nnn [infourl] => https://domain.com [from] => 2016-07-18 [to] => 2016-07-25 ) [pricing] => stdClass Object ( [price] => 1164.24 [clientInfo] => stdClass Object ( [firstName] => PERA [lastName] => PETROVI [email] => nnn@ravel.com ) [status] => 1 [offline] => 0 ) stdClass Object ( [id] => 11589607 [property] ... ... ... ... etc.
如何使用该数据创建 html?如何使用 foreach 并在该行中为每个 ID 创建表?
【问题讨论】:
标签: php html arrays json foreach