PDA

View Full Version : Block Variable


Exis
11-14-2005, 09:39 PM
How do you do a block of code for 1 variable, so that I can keep all of the variable information in a nice order and tell what is going on when I go to edit it? I don't really care if it is parsed in a nice neat order or not, but just so I can tell what I am doing when I edit the PHP.


$navigation = '<ul id="nav">
<li><a href="index.html">Home</a></li>
<li><a href="link1.htm">Link 1</a></li>


If I just do ' and ' at the beginning and ends, it doesn't capture everything...how do I quote multiple lines and have them all belong to 1 variable?

Exis
11-14-2005, 10:27 PM
Ok figured it out...man I always figure things out just after I post them :D

To do a mulitple line variable, heres how you can easily do it:


$navigation = <<<PARA
<ul id="nav">
<li><a href="index.html">Home</a></li>
<li><a href="link1.htm">Link 1</a></li>
PARA;

This will output the exact code, including line breaks, what variables really are (instead of just $variable), and extra lines! :eek: