1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
|
<?xml version="1.0" encoding="big5"?>
<chapter id="language.basic-syntax">
<title>yk</title>
<sect1 id="language.basic-syntax.phpmode">
<title>iJ PHP yҦ</title>
<para>
b HTML J PHP O@|ؤk: </para>
<para>
<example>
<title>Ways of escaping from HTML</title>
<programlisting>
1. <? echo ("this is the simplest, an SGML processing instruction\n"); ?>
2. <?php echo("if you want to serve XHTML or XML documents, do like this\n"); ?>
3. <script language="php">
echo ("some editors (like FrontPage) don't
like processing instructions");
</script>
4. <% echo ("You may optionally use ASP-style tags"); %>
<%= $variable; # This is a shortcut for "<%echo .." %>
</programlisting>
</example>
</para>
<para>
WCXkĤ@إu PHP Q]w "u" ɤ~|ġC ]wkiH
<!-- via the <function>short_tags</function> function,-->bճ] PHP.INI
<link linkend="ini.short-open-tag">short_open_tag</link>
]uȡA Ϊ̦bsĶ PHP ɰ <command>configure</command>
ɥ[J --enable-short-tags oӿﶵC
</para>
<para>
The second way is the generally preferred method, as it allows for the
next generation of XHTML to be easily implemented with PHP.
</para>
<para>
ĥ|ؤk]u ASP κA Q\ɤ~ġC oݭnճ]
<link linkend="ini.asp-tags">asp_tags</link>
oӰѼơC
<note>
<para> ASP-style Ҫ䴩q PHP 3.0.4 }l.</para>
</note></para>
<para>
{qаON|]AHb᪺ŸC (pŸܡC)
</para></sect1>
<sect1 id="language.basic-syntax.instruction-separation">
<title>jO</title>
<simpara>
PHP UO椧jkM CB PERL O@˪C - COΤ ";" }C </simpara>
<para>
ѩ{qҦP˥NOA ]HUq{OĪGO@˪C
<informalexample>
<programlisting>
<?php
echo "This is a test";
?>
<?php echo "This is a test" ?>
</programlisting>
</informalexample></para></sect1>
<sect1 id="language.basic-syntax.comments">
<title>[`k</title>
<para>
PHP WiH CB C++B M Unix shell `kC b`eNQ PHP C p :
<informalexample><programlisting>
<?php
echo "This is a test"; // This is a one-line c++ style comment
/* This is a multi line comment
yet another line of comment */
echo "This is yet another test";
echo "One Final Test"; # This is shell-style style comment
?>
</programlisting>
</informalexample></para>
<simpara>
ܩإu`Ѥ@檺`Ÿ@νdu|b椺ġC ( p椤PɥX{ PHP {FqŸ "?>" hbŸ᪺rN|QC)</simpara>
<informalexample><programlisting>
<h1>This is an <?php # echo "simple";?> example.</h1>
<p>The header above will say 'This is an example'.
</programlisting></informalexample>
<simpara>
pGO C 榡Ӱ`A `NnUүb`A[`A _h|y~C
</simpara>
<informalexample><programlisting>
<?php
/*
echo "This is a test"; /* This comment will cause a problem */
*/
?>
</programlisting></informalexample></sect1>
</chapter>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->
|