PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
$myvar =<<<END
<A HREF="https://www.paypal.com/affil/pal=ng%40mail.utexas.edu" target="_blank" onmouseover="window.status='http://www.paypal.com'; return true;" onmouseout="window.status=' '; return true;">
<IMG SRC="http://images.paypal.com/images/lgo/logo1.gif" BORDER="0" ALT="Send and accept payment through PayPal!, the #1 online payment service!">
</A>
END;
There's a bit of information on it in the documentation for echo():
php docs wrote:echo <<<END
This uses the "here document" syntax to output
multiple lines with $variable interpolation. Note
that the here document terminator must appear on a
line with just a semicolon no extra whitespace!
END;
I like it because it means I can cut and paste HTML without worrying about backslashes and it retains the formatting (tabs, linebreaks) that I give it so my source code looks pretty. But it can be a pain sometimes because it can produce odd parse errors if you get things slightly wrong. The main things to look out for are spaces after <<<END and END; (and any before END; too).
All you have to do is if you want to have certain quotes (") inside your variable, then just put a foreward-slash (\) infront of each one. In example; if you wanted the code (in HTML)...