-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathecho.xml
174 lines (153 loc) · 5.02 KB
/
echo.xml
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 96c9d88bad9a7d7d44bfb7f26c226df7ee9ddf26 Maintainer: cucinato Status: ready -->
<refentry xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://docbook.org/ns/docbook" xml:id="function.echo">
<refnamediv>
<refname>echo</refname>
<refpurpose>Visualizza una o più stringhe</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>void</type><methodname>echo</methodname>
<methodparam><type>string</type><parameter>arg1</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>...</parameter></methodparam>
</methodsynopsis>
<simpara>
Visualizza tutti i parametri.
</simpara>
<para>
<function>echo</function> in realtà non è una funzione (è un
costrutto del linguaggio) pertanto non richiede l'uso di
parentesi. <function>echo</function> (diversamente da altri costrutti
del linguaggio)) non si comporta come una funzion, quindi non può
essere sempre usata nel constesto di una funzione. Inoltre,se si vuole
passare più di un parametro a <function>echo</function>, i parametri
non devono essere racchiusi tra parentesi.
</para>
<para>
<function>echo</function> ha anche una sintassi abbreviata, nella quale si può
immediatamente seguire il simbolo di apertura del tag con un simbolo di uguale. questa sintassi abbreviata
funziona solo se la configurazione <link
linkend="ini.short-open-tag">short_open_tag</link> è
abilitata.
<informalexample>
<programlisting role="php">
<![CDATA[
Numero di foo: <?=$foo?>.
]]>
</programlisting>
</informalexample>
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>arg1</parameter></term>
<listitem>
<para>
Il parametro da visualizzare.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>...</parameter></term>
<listitem>
<para>
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.void;
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Esempi della funzione <function>echo</function></title>
<programlisting role="php">
<![CDATA[
<?php
echo "Hello World";
echo "This spans
multiple lines. The newlines will be
output as well";
echo "This spans\nmultiple lines. The newlines will be\noutput as well.";
echo "Escaping characters is done \"Like this\".";
// Si possono utilizzare variabili all'interno dei parametri di echo
$foo = "foobar";
$bar = "barbaz";
echo "foo is $foo"; // foo is foobar
// Si possono utilizzare anche delle matrici
$baz = array("value" => "foo");
echo "this is {$baz['value']} !"; // this is foo !
// Utilizzando gli apici singoli viene visualizzato il nome della variabile, non il valore
echo 'foo is $foo'; // foo is $foo
// Se non vi sono altri caratteri, si può visualizzare soltanto il contenuto delle variabili
echo $foo; // foobar
echo $foo,$bar; // foobarbarbaz
// Alcuni programmatori preferiscono passare i parametri come sequenza di stringhe concatenate.
echo 'This ', 'string ', 'was ', 'made ', 'with multiple parameters.', chr(10);
echo 'This ' . 'string ' . 'was ' . 'made ' . 'with concatenation.' . "\n";
echo <<<END
Questo esempio utilizza la sintassi "here document"
per visualizzare più linee oltre al contenuto di $variable
Notare che il terminatore del testo richiede
anche il punto e virgola, senza alcun spazio aggiuntivo!
END;
// Poiché echo non è una funzione la seguente riga non è valida.
($some_var) ? echo 'true' : echo 'false';
// Tuttavia la seguente funziona
($some_var) ? print 'true' : print 'false'; // print è un costrutto, ma
// si comporta come una funzione, quindi
// può essere utilizzato in questo contesto.
echo $some_var ? 'true': 'false'; // altra versione dell'istruzione
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
¬e.language-construct;
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>print</function></member>
<member><function>printf</function></member>
<member><function>flush</function></member>
<member><link linkend="language.types.string.syntax.heredoc">sintassi heredoc</link></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- 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:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->