0
這是我原來的代碼循環通過陣列
[Width] => Array
(
[0] => 400px
[1] => 323a
)
[Height] => Array
(
[0] => 244px
[1] => 244px
)
[Captions] => Array
(
[0] => [{ "captionId": 1,"caption": "Learning Clock Face is fun - you learn importance of time.","xyCordinates": "40px-250px","dimension": "70%-20%"},{"captionId": 2,"caption": "12 AM or 12 PM","xyCordinates": "40px-250px","dimension": "70%-20%"}]
[1] => [{ "captionId": 1,"caption": "Learning Clock Face is fun - you learn importance of time.","xyCordinates": "40px-250px","dimension": "70%-20%"},{"captionId": 2,"caption": "12 AM or 12 PM","xyCordinates": "40px-250px","dimension": "70%-20%"}]
)
)
上面的代碼是我實際的代碼,現在我需要循環它使我的代碼類似於下面的一個。請幫助我。
頁面ID不斷遞增。請幫我出
"Pages": [
{
"pageId": "1",
"resource": {
"width": "220px",
"height": "120px",
"captions": [
{
"captionId": 1,
"caption": "Learning alphabets is fun - you learn what to eat.",
"xyCordinates": "40px-250px",
"dimension": "70%-20%"
}
]
},
"pageOrder": 1,
"state": 1
}]
我已經獲得了上面提到的代碼。我需要以一種我覺得很困難的方式進行格式化。所以請幫助我 – user1734770