我需要创建一个包含对象集合的对象" ticket"。但它是什么?
这是一个具有嵌入对象tickets
的对象:
stdClass Object
(
[email] => asd@asd.ru
[phone] => +79243000155
[tickets] => stdClass Object
(
[ticketType] => Adult
[person] => Array
(
[fullName] => John Doe
[FirstName] => John
)
)
)
但tickets
必须表示为对象集合。它应该如何形成并创建?
答案 0 :(得分:0)
对于PHP,试试这个:
$array = array(
"email" => "asd@asd.ru",
"phone" => "+79243000155",
"tickets" => array(
"ticketType" => "Adult",
"person" => array(
"fullName" => "John Doe",
"FirstName" => "John"
)
)
);