对于 JAVA 开发,我需要使用诸如“\r\t\n <>”之类的字符串写入文件,因为从 Java 中我想编写一个 PHP 文件。如果你不明白看这个例子:
BufferedWriter buffW = new BufferedWriter(fileW);
buffW.write("<?php\n\n\tclass MyClass {\n\tpublic function test()\n}\n}\n?>");
这是一个混乱的代码,我想写一个干净的 PHP 可以做,但在 Java 上找不到替代方式作为示例:
<?php
$mystring = <<<EOT
This is some PHP text.
It is completely free
I can use "double quotes"
and 'single quotes',
plus $variables too, which will
be properly converted to their values,
you can even type EOT, as long as it
is not alone on a line, like this:
EOT;
?>