嗨,我正在尝试推送循环和数组并将其推送到我的新数组。我目前收到此错误..
array_push() 期望参数 1 是数组,字符串
我无法弄清楚为什么这不起作用,我的代码看起来像这样。
$data['text'] = array();
foreach( $this->xml['paragraphs']['paragraph'] as $array )
{
array_push($array['text'], $data);
}
我的阵列
[paragraphs] => Array
(
[paragraph] => Array
(
[0] => Array
(
[text] => Solid wood door leading to entrance hallway, doors leading to Lounge/ Dining room and Shower room, double radiator, solid wood frame sash window to front, painted wood panell ceiling with single light, Indian slate floor.
)
[1] => Array
(
[text] => Solid wood frame sash window to front, double radiator, bathroom suite comrising: shower cubicle with obscure perspex panells, WC and vanity sink. Painted wood panel ceiling with single light. Heated towel rail,
)