我有这个代码:
$new_news = '; array(
''img'' =>'.$path.',
''title'' => '.$_POST["title"].',
''text'' => '.$_POST["text"].'
)';
我需要将其添加到db.php中现有的数组中。例如:
$news = array(
array(
'img' => 'images/egle.jpg',
'title' => 'Egle pārtraukusi ',
'text' => 'Valsts prezidenta Andra '));
如何使用fopen()添加长度为4的$new_news?
将$new_news
更改为数组,而不是字符串。
$new_news = array(
'img' => $path,
'title' => $_POST["title"],
'text' => $_POST["text"]
);
$news[] = $new_news;