Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/arrays/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 在每个数组的末尾需要一个分号_Php_Arrays - Fatal编程技术网

Php 在每个数组的末尾需要一个分号

Php 在每个数组的末尾需要一个分号,php,arrays,Php,Arrays,当我在一个新的php文件中插入一个数组时,我不会在每个数组的末尾得到分号。我需要在每个数组的末尾得到一个分号 文件1 我以前没有这样做过,但是你不能再添加两个文件内容吗?结果如何 file_put_contents("staticSurveyDataFileTest.php", $file,"",true); file_put_contents("staticSurveyDataFileTest.php", "<?php\n","",true); file_put_contents("st

当我在一个新的php文件中插入一个数组时,我不会在每个数组的末尾得到分号。我需要在每个数组的末尾得到一个分号

文件1


我以前没有这样做过,但是你不能再添加两个
文件内容吗?结果如何

file_put_contents("staticSurveyDataFileTest.php", $file,"",true);
file_put_contents("staticSurveyDataFileTest.php", "<?php\n","",true);
file_put_contents("staticSurveyDataFileTest.php", $item,"itemFkids",true);
file_put_contents("staticSurveyDataFileTest.php", ";","",true);
file_put_contents("staticSurveyDataFileTest.php", $demo,"demoFkids",true);
file_put_contents("staticSurveyDataFileTest.php", ";","",true);
file_put_contents("staticSurveyDataFileTest.php", $comment,"commentFkids",true);
file_put_contents("staticSurveyDataFileTest.php", ";\n?>","",true);
file\u put\u内容(“staticSurveyDataFileTest.php”,$file,”,true);
文件内容(“staticSurveyDataFileTest.php”,“”,“”,true);

让我试试。给我一分钟
<?php
$itemFkids = Array
(
    "203_19" => "i27",
    "207_22" => "i28",
    "357_22" => "i99",
    "370_70" => "i104",
    "377_72" => "i105",
    "140_8" => "i1",
    "141_8" => "i2",
    "142_8" => "i3",
    "143_8" => "i4",
    "144_8" => "i5",

)//need a semicolon here
$demoFkids = Array
(
    "129_2" => "b1",
)//need a semicolon here
$commentFkids = Array
(
    "373_375" => "1",
    "380_382" => "2",
)//need a semicolon here
?>
file_put_contents("staticSurveyDataFileTest.php", $file,"",true);
file_put_contents("staticSurveyDataFileTest.php", "<?php\n","",true);
file_put_contents("staticSurveyDataFileTest.php", $item,"itemFkids",true);
file_put_contents("staticSurveyDataFileTest.php", ";","",true);
file_put_contents("staticSurveyDataFileTest.php", $demo,"demoFkids",true);
file_put_contents("staticSurveyDataFileTest.php", ";","",true);
file_put_contents("staticSurveyDataFileTest.php", $comment,"commentFkids",true);
file_put_contents("staticSurveyDataFileTest.php", ";\n?>","",true);