我有这样的代码:如何将文本添加到固定位置的文件php?
$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'到'$ news'吗?另外,你的意思是长度为4? – BenOfTheNorth
使用array_merge,$ news []与$ new_news – amitchhajer
我不明白,你是否真的试图将数据存储在.php文件中的数组? – hndr