Sorry, but is it EOF or EOP? I just realized that EOF didn't work in a test I made and when I went back to your post I realized you posted EOF once and EOP another time...
I made a test:
$phpvar = "test";
$string = <<<EOP
this 'is' a "$phpvar" and I love it
EOP;
echo $string;
It worked. The output was:
this 'is' a "test" and I love it
But then I run another test which was:
$phpvar = "test";
$string = <<<EOP
this 'is' a "
EOP;
echo $phpvar;
$string .= <<<EOP
" and I love it
EOP;
echo $string;
and the result wasn't quite perfect as it printed:
testthis 'is' a "" and I love it
I would love to use the first of the two methods but I need to be able to apply str_replace() and stripslashes() etc to my variables and arrays INSIDE the EOF/P...
I would like to be able to do this:
$string = <<<EOP
this 'is' a ".stripslashes($phpvar)." and I love it
EOP;
or at least this:
$string = <<<EOP
this 'is' a "EOP;stripslashes($phpvar)<<<EOP
" and I love it
EOP;
but of course they both don't work... is there a way around it besides applying the functions on the variable in the line before the variable is put into the EOP string?
Also the value of the $phpvar or array be printed inside the EOP so that if I am creating a new file on disk with fopen() and the $string lines are the lines of the new file, this new file will actually contain the value of the variable and not the variable itself (which would of course not have a value assigned to it)?