A jelpárok közé kell írni a kódot:
<?php
...
?>
<script language="php">
...
</script>
<%
...
/%>
Példa:
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Listing 3.2 A PHP Script Including HTML</title>
</head>
<body>
<div><b>
<?php
print "hello world";
?>
</b></div>
<p>
<!--; Allow ASP-style <% %> tags.-->
<!--; http://php.net/asp-tags-->
<!--asp_tags = Off-->
</p> <%
print "szia"
//ez nem megy nalam
/%>
<p>
</p>
<script language="php">
print "scriptes"
</script>
</body>
</html>
A kimenet:
hello world
<% print "szia" //ez nem megy nalam /%>
scriptes
Nincsenek megjegyzések:
Megjegyzés küldése