我有一个这样的数组:
数组 ( [0] => stdClass Object ( [id] => 1 [title] => ABC [sentece] => blablabla... [topic] => Science ) [1] => stdClass Object ( [id] = > 2 [title] => DEF [sentence] => nomnomnom... [topic] => 技术)
如何在 php 的 stdClass 对象中添加一个数组?
例如:我想添加这个数组:
$number = array (82, 61);
所以,我会有这个数组:
Array ( [0] => stdClass Object ( [id] => 1 [title] => ABC [sentece] => blablabla... [topic] => Science [number] => 82 ) [1] => stdClass对象 ( [id] => 2 [title] => DEF [sentece] => nomnomnom... [topic] => 技术 [number] => 61
)
谢谢你的帮助。