我有这样的源代码:
<?php
if(isset($_POST['text_boxx'])) {
$aa = $_POST['text_boxx'];
$myFilee = "./SCENARIO/ocstesting-aktif.txt";
$fhh = fopen($myFilee, 'w') or die("can't open file");
fwrite($fhh,$aa);
fclose($fhh);
}
if(isset($myFilee)){
$myFilee2 = "./SCENARIO/ocstesting.txt";
$fhh2 = fopen($myFilee2, 'w') or die("can't open file");
$filer = file('./SCENARIO/ocstesting-aktif.txt');
foreach ($filer as $file_num => $fileline){
$aaa="{$file_num}. Hello my name is: " . $fileline . " hoho \n";
fwrite($fhh2,$aaa);
}
fclose($fhh2);
}
?>
如果我在文本框中输入:
Oki
Dito
我希望它出现在网络中:
0. Hello my name is Oki hoho
1. Hello my name is Dito hoho
但似乎:
0. Hello my name is: Oki
hoho
1. Hello my name is: Dito hoho
请有人可以帮忙:(?谢谢
答案 0 :(得分:0)
你应该按以下方式写这一行
$aaa="{$file_num}. Hello my name is " . $fileline . " hoho \n";
只需省略:after is。
答案 1 :(得分:0)