|
Posted by Matt F on 05/31/07 14:45
I can't seem to get heredoc to populate correctly with variables through
a form.
<textarea name="Template" rows="10" cols="80">Template Here</textarea>
Contents could be something like: I want to replace $myarray[0] and
another variable $myarray[1]
I call heredoc this way:
$hubarray = explode("\n", $contents);
$template = $_POST['Template'];
foreach ($hubarray as $val) {
$hostarray = explode(",", $val);
$output = <<<EOT
$template
EOT;
I'm feeding it a file that has multiple rows separated by \n as array 1
and within those rows are fields separated by "," for array 2. I'm
trying to iterate through the arrays and populate heredoc($template)
accordingly.
Navigation:
[Reply to this message]
|