How to Mix Xhtml and PHP?
In order to mix Xhmtl and PHP, it must be set with PHP start / End tags.
"<"""!DOCTYPE html PUBLIC "-//W3C//DTD/XHTML 1.0 Transitional//EN""""
""""http://www.w3.org/TR/xhtml1/DTD/xhtml11-transitional.dtd"""">
<""""html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"""">
<""head""">
<"""title""">A Web Page</title""">
<"""/head""">
<"""body""">
<"""p""">
<"""?php echo "learn basic";?""">
<"""/p""">
<"""p""">
<"""?print "Here's a mix!";?""">
<"""/p""">
<"""p""">
<"""script language="php"""">
"""$myvar = "Everything is fine"""";
"""echo $myvar""";
<"""/script""">
<"""/p""">
<"""/body""">
<"""/html""">
The above includes the following -
Three PHP block in Xhtml document -
First block -
<"""php ... ?""">
Open and close tag
It also uses PHP echo
The second uses <"""? ... ?"""> inorder to mark the beginning the start and end
It uses PHP print in order to display the text
The Third block uses <"""script language="php""""> ... <"""/script"""> to give it to start and end of PHP code
*Please remove """ from all lines before applying
|