Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Embedding PHP in XHTML

Status
Not open for further replies.

McBugzz

Programmer
Sep 17, 2002
90
JP
Problem:

XHTML documents start with <?xml...
PHP parser doesn't like that - thinks it's some kind of a wrong statement. How can these two things be combined? Proper XHTML and happy PHP parser?
 
Change your metaphore. Don't think of it as embedding PHP in XHTML. Think of it as using PHP to output XHTML.

In such a case, you have a &quot;<?php&quot; tag at the beginning of your script and use PHP print statements to output your XHTML.

Want the best answers? Ask the best questions: TANSTAAFL!!
 
Code:
<?php 
echo &quot;<?xml version=\&quot;1.0\&quot; encoding=\&quot;iso-8859-1\&quot;?&quot;.&quot;>&quot;; 
?>


There, I knew Dreamweaver was useful for something ;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top