I am getting a syntax error:
unexpected ']'
Here is my code:
<?php
$output = "";
for ($i=1; $i<16; $i++) {
$output .= $_POST["DepositCode" . i . ] . "," . $_POST["textfield" . i . ] . "," . $_POST["AccountNum" . i . ] . " \r\n";
}
$file ='textt.txt';
file_put_contents($file, $output);
?>
$_POST["DepositCode" . i]
- remove the last dot (.
) – hafichuk Nov 28 '11 at 16:41