Writing text without switching from PHP to HTML

posted by iup85 on 2009-11-11 00:33:45
Hi
Newb question here. Is there any way I can get a
<br />
or equivalent
without closing my PHP tags and re-opening them afterwards?
Thanks for any help
best71
0
Echo what you want, though this is uglier than hell. PHP is an excellent
templating language and switching between HTML and PHP is really not that
big of a deal. Anyway....
echo "<br />"; 
or
you can use heredoc syntax to put a full HTML document inside:
$str = <<<EOD 
Example of string 
spanning multiple lines 
using heredoc syntax. 
EOD; 
 
or
$name = 'MyName'; 
echo <<<EOT 
My name is "$name". I am printing some text. 
This should print a capital 'A': \x41 
EOT; 
2 answers - 3 questions
  Positive      - 1  Negative

Mortuus
0
 echo "<p> Your HTML Code</p>";
For example.
1 answers - 0 questions
  Positive        Negative



Answer the question



Top Users
  • dail (12)
  • livin52 (3)
  • camu (3)
  • softweb (2)
  • Nadine (1)
  • Josware (1)
  • lfelipecr (1)
  • gregoriohc (1)
  • Mitu (1)
  • ryan714 (1)