File: basic-syntax.xml

package info (click to toggle)
phpdoc 20020310-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 35,272 kB
  • ctags: 354
  • sloc: xml: 799,767; php: 1,395; cpp: 500; makefile: 200; sh: 140; awk: 51
file content (130 lines) | stat: -rw-r--r-- 4,166 bytes parent folder | download
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
129
130
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- up-to-date against phpdoc/en/language/basic-syntax.xml:1.3 -->
  <chapter id="language.basic-syntax">
   <title>Basis syntax</title>

   <sect1 id="language.basic-syntax.phpmode">
    <title>Uittreden uit HTML</title>
  
    <para>
     Er zijn vier manieren om uit HTML te treden en "PHP code
     mode" binnen te komen:</para>

    <para>
     <example>
      <title>Manieren om PHP te embedden in HTML</title>
      <programlisting>
1.  &lt;? echo ("dit is de makkelijste, als een SGML processing instructie\n"); ?&gt;
 
2.  &lt;?php echo("als je XML documenten wilt publiceren, gebruik dan deze methode\n"); ?&gt;

3.  &lt;script language="php"&gt;
        echo ("sommige editors (zoals FrontPage) gaan slecht
              met processing instructies om");
    &lt;/script&gt;

4.  &lt;% echo ("Optioneel kun je ASP-stijl tags gebruiken"); %&gt;
    &lt;%= $variable; # Dit is kort voor: "&lt;%echo .." %&gt;
      </programlisting>
     </example></para>

    <para>
     De als eerste beschreven manier is alleen beschikbaar als &quot;short
     tags&quot; zijn aangezet. Dit kan worden gedaan met
     <!-- de <function>short_tags</function> functie, die aan te zetten is door-->
     de <link linkend="ini.short-open-tag">short_open_tag</link> configuratie
     setting in het PHP configuratie bestand, of door PHP te compileren
     met de <command>configure</command> optie --enable-short-tags.</para>

    <para>
     De vierde manier die is beschreven, is alleen beschikbaar als
     ASP-stijl tags zijn geactiveerd met de
     <link linkend="ini.asp-tags">asp_tags</link>
     configuratie setting.

    <note>
     <para>De ASP-stijl tags zijn toegevoegd in PHP in 3.0.4.</para>
    </note></para>

    <para>
     De sluit tag voor een block neemt een onmiddelijk opeenvolgende
     newline (\n) mee als deze aanwezig is.</para></sect1>

   <sect1 id="language.basic-syntax.instruction-separation">
    <title>Het scheiden van instructies</title>

    <simpara>
     Instructies worden gescheden op dezelfde manier als in C en PERL,
     elk statement moet worden afgesloten met een puntkomma.</simpara>

    <para>
     De sluit tag (?&gt;) impliceerd ook het einde van een statement,
     daarom zijn de volgende twee voorbeelden aan elkaar gelijk:

     <informalexample>
      <programlisting>
&lt;?php
    echo "Dit is een test";
?>

&lt;?php echo "Dit is een test" ?>
      </programlisting>
     </informalexample></para></sect1>

   <sect1 id="language.basic-syntax.comments">
    <title>Opmerkingen</title>
   
    <para>
     PHP ondersteund 'C', 'C++' en Unix shell-stijl commentaar.
     Bijvoorbeeld:

    <informalexample><programlisting>
&lt;?php
    echo "Dit is een test"; // Dit is een-regelig c++ commentaar
    /* Dit is meer regelig commentaar
       en weer een lijntje commentaat */
    echo "Dit is weer een andere test";
    echo "De Laatste test"; # Dit is shell-style comentaar
?>
     </programlisting>
    </informalexample></para>

    <simpara>
     De "een-regel" commentaar stijlen commentariseren tot het einde
     van de lijn, of tot het einde van een blok PHP code.</simpara>
    <informalexample><programlisting>
&lt;h1&gt;Dit is een &lt;?# echo "simple";?&gt; voorbeeld.&lt;/h1&gt;
&lt;p&gt;De header hierboven geeft 'Dit is een voorbeeld'.
</programlisting></informalexample> 

    <simpara>
     Je moet uitkijken met het nesten van 'C' stijl commentaar, dit is
     niet toegestaan in PHP en kan voorkomen bij het uitcommentariseren
     van grote stukken code.</simpara>

    <informalexample><programlisting>
&lt;?php
 /* 
    echo "Dit is een test"; /* Dit stuk commentaar zorgt voor een probleem */
 */
?&gt;
    </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:
 -->