cvs: /phpdoc/language basic-syntax.sgml constants.sgml control-structures.sgml expressions.sgml functions.sgml oop.sgml operators.sgml types.sgml
variables.sgml
| From: | Torben Wilson | Date: | Wed, 20 Oct 1999 22:52:32 +0000 |
| Subject: | cvs: /phpdoc/language basic-syntax.sgml constants.sgml control-structures.sgml expressions.sgml functions.sgml oop.sgml operators.sgml types.sgml variables.sgml |
||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-11793@lists.php.net to get a copy of this message | ||
cslawi Wed Oct 20 18:52:32 1999 EDT
Modified files:
/phpdoc/language basic-syntax.sgml constants.sgml
control-structures.sgml expressions.sgml
functions.sgml oop.sgml operators.sgml types.sgml
variables.sgml
Log:
Normalized according to the DocBook 3.1 DTD. This mostly just adds
closing tags and attribute quotes, but lets a stock 3.1 install
compile the PHP docs. It still compiles with DocBook 3.0, as well.
Index: phpdoc/language/basic-syntax.sgml
diff -u phpdoc/language/basic-syntax.sgml:1.2 phpdoc/language/basic-syntax.sgml:1.3
--- phpdoc/language/basic-syntax.sgml:1.2 Tue Sep 21 04:58:05 1999
+++ phpdoc/language/basic-syntax.sgml Wed Oct 20 18:52:31 1999
@@ -6,7 +6,7 @@
<para>
There are four ways of escaping from HTML and entering "PHP code
- mode":
+ mode":</para>
<para>
<example>
@@ -24,15 +24,14 @@
4. <% echo ("You may optionally use ASP-style tags"); %>
<%= $variable; # This is a shortcut for "<%echo .." %>
</programlisting>
- </example>
+ </example></para>
<para>
The first way is only available if short tags have been
enabled. This can be done via the <function>short_tags</function>
- function, by enabling the <link
- linkend="ini.short-open-tag">short_open_tag</link> configuration
+ function, by enabling the <link
linkend="ini.short-open-tag">short_open_tag</link> configuration
setting in the PHP config file, or by compiling PHP with the
- --enable-short-tags option to <command>configure</command>.
+ --enable-short-tags option to <command>configure</command>.</para>
<para>
The fourth way is only available if ASP-style tags have been
@@ -41,18 +40,18 @@
<note>
<para>Support for ASP-style tags was added in 3.0.4.</para>
- </note>
+ </note></para>
<para>
The closing tag for the block will include the immediately
- trailing newline if one is present.
+ trailing newline if one is present.</para></sect1>
<sect1 id="language.basic-syntax.instruction-separation">
<title>Instruction separation</title>
<simpara>
Instructions are separated the same as in C or perl - terminate
- each statement with a semicolon.
+ each statement with a semicolon.</simpara>
<para>
The closing tag (?>) also implies the end of the statement, so the
@@ -66,7 +65,7 @@
<?php echo "This is a test" ?>
</programlisting>
- </informalexample>
+ </informalexample></para></sect1>
<sect1 id="language.basic-syntax.comments">
<title>Comments</title>
@@ -83,12 +82,12 @@
echo "One Final Test"; # This is shell-style style comment
?>
</programlisting>
- </informalexample>
+ </informalexample></para>
<simpara>
The "one-line" comment styles actually only comment to the
end of the line or the current block of PHP code, whichever
- comes first.
+ comes first.</simpara>
<informalexample><programlisting>
<h1>This is an <?# echo "simple";?> example.</h1>
<p>The header above will say 'This is an example'.
@@ -96,7 +95,7 @@
<simpara>
You should be careful not to nest 'C' style comments, which can
- happen when commenting out large blocks.
+ happen when commenting out large blocks.</simpara>
<informalexample><programlisting>
<?php
@@ -104,7 +103,7 @@
echo "This is a test"; /* This comment will cause a problem */
*/
?>
- </programlisting></informalexample>
+ </programlisting></informalexample></sect1>
</chapter>
<!-- Keep this comment at the end of the file
Index: phpdoc/language/constants.sgml
diff -u phpdoc/language/constants.sgml:1.1 phpdoc/language/constants.sgml:1.2
--- phpdoc/language/constants.sgml:1.1 Sat Jun 19 22:25:34 1999
+++ phpdoc/language/constants.sgml Wed Oct 20 18:52:31 1999
@@ -6,7 +6,7 @@
defining more at run-time. Constants are much like variables,
save for the two facts that constants must be defined using the
<function>define</function> function, and that they cannot later be
- redefined to another value.
+ redefined to another value.</simpara>
<para>
The predefined constants (always available) are:
@@ -116,16 +116,16 @@
</simpara>
</listitem>
</varlistentry>
- </variablelist>
+ </variablelist></para>
<para>
The E_* constants are typically used with the
<function>error_reporting</function> function for setting the
- error reporting level.
+ error reporting level.</para>
<para>
You can define additional constants using the
- <function>define</function> function.
+ <function>define</function> function.</para>
<para>
Note that these are constants, not C-style macros; only valid
@@ -152,7 +152,7 @@
report_error(__FILE__,__LINE__, "Something went wrong!");
?>
</programlisting>
- </example>
+ </example></para>
</chapter>
Index: phpdoc/language/control-structures.sgml
diff -u phpdoc/language/control-structures.sgml:1.4 phpdoc/language/control-structures.sgml:1.5
--- phpdoc/language/control-structures.sgml:1.4 Sat Jul 31 20:46:16 1999
+++ phpdoc/language/control-structures.sgml Wed Oct 20 18:52:31 1999
@@ -8,7 +8,7 @@
usually end with a semicolon. In addition, statements can be grouped
into a statement-group by encapsulating a group of statements with
curly braces. A statement-group is a statement by itself as well. The
- various statement types are described in this chapter.
+ various statement types are described in this chapter.</simpara>
<sect1 id="control-structures.if">
<title><literal>if</literal></title>
@@ -22,13 +22,13 @@
<informalexample><programlisting>
if (expr)
statement
- </programlisting></informalexample>
+ </programlisting></informalexample></para>
<simpara>
As described in the section about expressions, expr is evaluated
to its truth value. If <replaceable>expr</replaceable> evaluates
to <literal>TRUE</literal>, PHP will execute statement, and if it
- evaluates to <literal>FALSE</literal> - it'll ignore it.
+ evaluates to <literal>FALSE</literal> - it'll ignore it.</simpara>
<para>
The following example would display <computeroutput>a is bigger
@@ -38,7 +38,7 @@
<informalexample><programlisting>
if ($a > $b)
print "a is bigger than b";
- </programlisting></informalexample>
+ </programlisting></informalexample></para>
<para>
Often you'd want to have more than one statement to be executed
@@ -55,13 +55,13 @@
print "a is bigger than b";
$b = $a;
}
- </programlisting></informalexample>
+ </programlisting></informalexample></para>
<simpara>
If statements can be nested indefinitely within other
<literal>if</literal> statements, which provides you with complete
flexibility for conditional execution of the various parts of
- your program.
+ your program.</simpara></sect1>
<sect1 id="control-structures.else">
<title><literal>else</literal></title>
@@ -91,7 +91,7 @@
if the <literal>if</literal> expression evaluated to
<literal>FALSE</literal>, and if there were any
<literal>elseif</literal>
expressions - only if they evaluated to <literal>FALSE</literal>
- as well (see below).
+ as well (see below).</para></sect1>
<sect1 id="control-structures.elseif">
<title><literal>elseif</literal></title>
@@ -120,7 +120,7 @@
print "a is smaller than b";
}
</programlisting>
- </informalexample>
+ </informalexample></para>
<simpara>
There may be several <literal>elseif</literal>s within the same
@@ -130,13 +130,13 @@
words) and the behavior would be identical to the one of 'elseif'
(in a single word). The syntactic meaning is slightly different
(if you're familiar with C, this is the same behavior) but the
- bottom line is that both would result in exactly the same behavior.
+ bottom line is that both would result in exactly the same behavior.</simpara>
<simpara>
The <literal>elseif</literal> statement is only executed if the preceding
<literal>if</literal> expression and any
preceding <literal>elseif</literal> expressions evaluated to
<literal>FALSE</literal>, and the current
- <literal>elseif</literal> expression evaluated to
<literal>TRUE</literal>.
+ <literal>elseif</literal> expression evaluated to
<literal>TRUE</literal>.</simpara></sect1>
<sect1 id="control-structures.alternative-syntax">
<title>Alternative syntax for <literal>if</literal> structures:
<literal>if(): ... endif;</literal></title>
@@ -156,12 +156,12 @@
A = 5
<?php endif; ?>
</programlisting>
- </informalexample>
+ </informalexample></para>
<simpara>
In the above example, the HTML block "A = 5" is nested within an
<literal>if</literal> statement written in the alternative syntax.
- The HTML block would be displayed only if $a is equal to 5.
+ The HTML block would be displayed only if $a is equal to 5.</simpara>
<para>
The alternative syntax applies to <literal>else</literal>
@@ -181,7 +181,7 @@
print "a is neither 5 nor 6";
endif;
</programlisting>
- </informalexample>
+ </informalexample></para></sect1>
<sect1 id="control-structures.while">
<title><literal>while</literal></title>
@@ -195,7 +195,7 @@
<programlisting>
while (expr) statement
</programlisting>
- </informalexample>
+ </informalexample></para>
<simpara>
The meaning of a <literal>while</literal> statement is simple.
@@ -208,7 +208,7 @@
time PHP runs the statements in the loop is one iteration).
Sometimes, if the <literal>while</literal> expression evaluates
to <literal>FALSE</literal> from the very beginning, the nested
- statement(s) won't even be run once.
+ statement(s) won't even be run once.</simpara>
<para>
Like with the <literal>if</literal> statement, you can group
@@ -219,7 +219,7 @@
<informalexample>
<programlisting>
while (expr): statement ... endwhile;
- </programlisting></informalexample>
+ </programlisting></informalexample></para>
<para>
The following examples are identical, and both print numbers from
@@ -244,7 +244,7 @@
$i++;
endwhile;
</programlisting>
- </informalexample>
+ </informalexample></para></sect1>
<sect1 id="control-structures.do.while">
@@ -261,7 +261,7 @@
with a regular <literal>while</literal> loop (the truth expression
is checked at the beginning of each iteration, if it evaluates
to <literal>FALSE</literal> right from the beginning, the loop
- execution would end immediately).
+ execution would end immediately).</simpara>
<para>
There is just one syntax for <literal>do..while</literal> loops:
@@ -273,20 +273,19 @@
print $i;
} while ($i>0);
</programlisting>
- </informalexample>
+ </informalexample></para>
<simpara>
The above loop would run one time exactly, since after the first
iteration, when truth expression is checked, it evaluates to
<literal>FALSE</literal> ($i is not bigger than 0) and the loop
- execution ends.
+ execution ends.</simpara>
<para>
Advanced C users may be familiar with a different usage of
the <literal>do..while</literal> loop, to allow stopping
execution in the middle of code blocks, by encapsulating
- them with <literal>do..while</literal>(0), and using the <link
-
linkend="control-structures.break"><literal>break</literal></link>
statement.
+ them with <literal>do..while</literal>(0), and using the <link
linkend="control-structures.break"><literal>break</literal></link>
statement.
The following code fragment demonstrates this:
<informalexample>
@@ -304,12 +303,12 @@
...process i...
} while(0);
</programlisting>
- </informalexample>
+ </informalexample></para>
<simpara>
Don't worry if you don't understand this right away or at all.
You can code scripts and even powerful scripts without using this
- `feature'.
+ `feature'.</simpara></sect1>
<sect1 id="control-structures.for">
<title><literal>for</literal></title>
@@ -323,21 +322,21 @@
<programlisting>
for (expr1; expr2; expr3) statement
</programlisting>
- </informalexample>
+ </informalexample></para>
<simpara>
The first expression (<replaceable>expr1</replaceable>) is evaluated
- (executed) once unconditionally at the beginning of the loop.
+ (executed) once unconditionally at the beginning of the loop.</simpara>
<simpara>
In the beginning of each iteration, <replaceable>expr2</replaceable>
is evaluated. If it evaluates to <literal>TRUE</literal>, the
loop continues and the nested statement(s) are executed. If it
- evaluates to <literal>FALSE</literal>, the execution of the loop ends.
+ evaluates to <literal>FALSE</literal>, the execution of the loop
ends.</simpara>
<simpara>
At the end of each iteration, <replaceable>expr3</replaceable>
- is evaluated (executed).
+ is evaluated (executed).</simpara>
<simpara>
Each of the expressions can be empty.
@@ -345,9 +344,8 @@
the loop should be run indefinitely (PHP implicitly
considers it as <literal>TRUE</literal>, like C).
This may not be as useless as you might think, since
- often you'd want to end the loop using a conditional <link
-
linkend="control-structures.break"><literal>break</literal></link>
statement
- instead of using the <literal>for</literal> truth expression.
+ often you'd want to end the loop using a conditional <link
linkend="control-structures.break"><literal>break</literal></link>
statement
+ instead of using the <literal>for</literal> truth expression.</simpara>
<para>
Consider the following examples. All of them display numbers from
@@ -385,13 +383,13 @@
for ($i = 1; $i <= 10; print $i, $i++) ;
</programlisting>
- </informalexample>
+ </informalexample></para>
<simpara>
Of course, the first example appears to be the nicest one (or
perhaps the fourth), but you may find that being able to use empty
expressions in <literal>for</literal> loops comes in handy in
- many occasions.
+ many occasions.</simpara>
<para>
PHP also supports the alternate "colon syntax" for
@@ -401,13 +399,13 @@
<programlisting>
for (expr1; expr2; expr3): statement; ...; endfor;
</programlisting>
- </informalexample>
+ </informalexample></para>
<para>
Other languages have a foreach statement to traverse an array or
hash. PHP uses the while statement and the <function>list</function>
and <function>each</function> functions for this. See the
- documentation for these functions for an example.
+ documentation for these functions for an example.</para></sect1>
<sect1 id="control-structures.break">
@@ -426,7 +424,7 @@
$i++;
}
</programlisting>
- </informalexample>
+ </informalexample></para></sect1>
<sect1 id="control-structures.continue">
<title><literal>continue</literal></title>
@@ -445,7 +443,7 @@
do_something_odd ($value);
}
</programlisting>
- </informalexample>
+ </informalexample></para></sect1>
<sect1 id="control-structures.switch">
<title><literal>switch</literal></title>
@@ -456,7 +454,7 @@
you may want to compare the same variable (or expression) with
many different values, and execute a different piece of code
depending on which value it equals to. This is exactly what the
- <literal>switch</literal> statement is for.
+ <literal>switch</literal> statement is for.</simpara>
<para>
The following two examples are two different ways to write the
@@ -487,7 +485,7 @@
break;
}
</programlisting>
- </informalexample>
+ </informalexample></para>
<para>
It is important to understand how the <literal>switch</literal>
@@ -514,7 +512,7 @@
print "i equals 2";
}
</programlisting>
- </informalexample>
+ </informalexample></para>
<simpara>
Here, if $i equals to 0, PHP would execute all of the print
@@ -523,7 +521,7 @@
'expected' behavior and only 'i equals 2' would be displayed. So,
it's important not to forget <literal>break</literal> statements
(even though you may want to avoid supplying them on purpose under
- certain circumstances).
+ certain circumstances).</simpara>
<para>
The statement list for a case can also be empty, which simply
@@ -540,7 +538,7 @@
print "i is 3";
}
</programlisting>
- </informalexample>
+ </informalexample></para>
<para>
A special case is the default case. This case matches anything
@@ -562,20 +560,20 @@
print "i is not equal to 0, 1 or 2";
}
</programlisting>
- </informalexample>
+ </informalexample></para>
<para>
The <literal>case</literal> expression may be any expression that
evaluates to a scalar type, that is, integer or floating-point
numbers and strings. Arrays or objects are meaningless in that
- context.
+ context.</para></sect1>
<sect1 id="function.require">
<title><literal>require</literal></title>
<simpara>
The <literal>require</literal> statement replaces itself with the
- specified file, much like the C preprocessor's #include works.
+ specified file, much like the C preprocessor's #include works.</simpara>
<para>
This means that you can't put a <literal>require</literal>
@@ -587,14 +585,14 @@
<programlisting>
require 'header.inc';
</programlisting>
- </informalexample>
+ </informalexample></para></sect1>
<sect1 id="function.include">
<title><literal>include</literal></title>
<simpara>
The <literal>include</literal> statement includes and evaluates
- the specified file.
+ the specified file.</simpara>
<para>
This happens each time the <literal>include</literal> statement is
@@ -608,23 +606,21 @@
include $files[$i];
}
</programlisting>
- </informalexample>
+ </informalexample></para>
<para>
<link
linkend="function.include"><literal>include</literal></link>
- differs from <link
- linkend="function.require"><literal>require</literal></link>
+ differs from <link
linkend="function.require"><literal>require</literal></link>
in that the include statement is re-evaluated each time it is
encountered (and only when it is being executed), whereas the
<link
linkend="function.require"><literal>require</literal></link>
statement is replaced by the required file when it is first
encountered, whether the contents of the file will be evaluated or
not (for example, if it is inside an if statement whose condition
- evaluated to false).
+ evaluated to false).</para>
<para>
- Because <link
- linkend="function.include"><literal>include</literal></link> is
a
+ Because <link
linkend="function.include"><literal>include</literal></link> is a
special language construct, you must enclose it within a statement
block if it is inside a conditional block.
@@ -645,16 +641,16 @@
include($other);
}
</programlisting>
- </informalexample>
+ </informalexample></para>
<para>
When the file is evaluated, the parser begins in "HTML-mode" which
will output the contents of the file until the first PHP start tag
- (<?) is encountered.
+ (<?) is encountered.</para>
<para>
See also <function>readfile</function>, <function>require</function>,
- <function>virtual</function>.
+ <function>virtual</function>.</para></sect1>
</chapter>
Index: phpdoc/language/expressions.sgml
diff -u phpdoc/language/expressions.sgml:1.3 phpdoc/language/expressions.sgml:1.4
--- phpdoc/language/expressions.sgml:1.3 Sat Jul 31 20:58:48 1999
+++ phpdoc/language/expressions.sgml Wed Oct 20 18:52:31 1999
@@ -5,20 +5,20 @@
Expressions are the most important building stones of PHP. In PHP,
almost anything you write is an expression. The simplest yet
most accurate way to define an expression is "anything that has a
- value".
+ value".</simpara>
<simpara>
The most basic forms of expressions are constants and variables.
When you type "$a = 5", you're assigning '5' into $a. '5',
obviously,
has the value 5, or in other words '5' is an expression with the
- value of 5 (in this case, '5' is an integer constant).
+ value of 5 (in this case, '5' is an integer constant).</simpara>
<simpara>
After this assignment, you'd expect $a's value to be 5 as
well, so if you wrote $b = $a, you'd expect it to behave just as
if you wrote $b = 5. In other words, $a is an expression with the
value of 5 as well. If everything works right, this is exactly
- what will happen.
+ what will happen.</simpara>
<para>
Slightly more complex examples for expressions are functions. For
@@ -30,7 +30,7 @@
return 5;
}
</programlisting>
- </informalexample>
+ </informalexample></para>
<simpara>
Assuming you're familiar with the concept of functions (if you're
@@ -39,7 +39,7 @@
writing <literal>$c = 5</literal>, and you're right. Functions
are expressions with the value of their return value. Since foo()
returns 5, the value of the expression 'foo()' is 5. Usually
- functions don't just return a static value but compute something.
+ functions don't just return a static value but compute something.</simpara>
<simpara>
Of course, values in PHP don't have to be integers, and very often
@@ -48,7 +48,7 @@
you can't 'break' into smaller pieces, unlike arrays, for instance).
PHP also supports two composite (non-scalar) types: arrays and
objects. Each of these value types can be assigned into variables or
- returned from functions.
+ returned from functions.</simpara>
<simpara>
So far, users of PHP/FI 2 shouldn't feel any change. However, PHP
@@ -65,7 +65,7 @@
is an expression with the value 5. Thus, writing something like
'$b = ($a = 5)' is like writing '$a = 5; $b = 5;' (a semicolon
marks the end of a statement). Since assignments are parsed in a
- right to left order, you can also write '$b = $a = 5'.
+ right to left order, you can also write '$b = $a = 5'.</simpara>
<simpara>
Another good example of expression orientation is pre- and
@@ -85,7 +85,7 @@
value, thus the name 'pre-increment'). Post-increment, which is
written '$variable++' evaluates to the original value of
$variable, before it was incremented (PHP increments the variable
- after reading its value, thus the name 'post-increment').
+ after reading its value, thus the name 'post-increment').</simpara>
<simpara>
A very common type of expressions are comparison expressions.
@@ -94,7 +94,7 @@
or equal to), == (equal), != (not equal), < (smaller than) and <=
(smaller than or equal to). These expressions are most commonly used
inside conditional execution, such as <literal>if</literal>
- statements.
+ statements.</simpara>
<simpara>
The last example of expressions we'll deal with here is combined
@@ -116,7 +116,7 @@
3, but the combined value of $a plus 3 (this is the value that's
assigned into $a). Any two-place operator can be used in this
operator-assignment mode, for example '$a -= 5' (subtract 5 from
- the value of $a), '$b *= 7' (multiply the value of $b by 7), etc.
+ the value of $a), '$b *= 7' (multiply the value of $b by 7), etc.</simpara>
<para>
There is one more expression that may seem odd if you haven't seen
@@ -129,7 +129,7 @@
If the value of the first subexpression is true (non-zero), then
it the second subexpression is evaluated, and that is the result
of the conditional expression. Otherwise, the third subexpression
- is evaluated, and that is the value.
+ is evaluated, and that is the value.</para>
<para>
The following example should help you understand pre- and
@@ -156,7 +156,7 @@
value of 24. the value of the assignment (24) is
then assigned into $h, and $h ends with the value
of 24 as well. */
-</programlisting></informalexample>
+</programlisting></informalexample></para>
<simpara>
In the beginning of the chapter we said that we'll be describing
@@ -165,7 +165,7 @@
this case, a statement has the form of 'expr' ';' that is, an
expression followed by a semicolon. In '$b=$a=5;', $a=5 is a
valid expression, but it's not a statement by itself. '$b=$a=5;'
- however is a valid statement.
+ however is a valid statement.</simpara>
<simpara>
One last thing worth mentioning is the truth value of expressions.
@@ -179,7 +179,7 @@
string and the string "0" are FALSE; all other strings are TRUE.
With non-scalar values (arrays and objects) - if the value
contains no elements it's considered FALSE, otherwise it's
- considered TRUE.
+ considered TRUE.</simpara>
<simpara>
PHP provides a full and powerful implementation of expressions, and
@@ -187,7 +187,7 @@
above examples should give you a good idea about what expressions
are and how you can construct useful expressions. Throughout the
rest of this manual we'll write <replaceable>expr</replaceable>
- to indicate any valid PHP expression.
+ to indicate any valid PHP expression.</simpara>
</chapter>
Index: phpdoc/language/functions.sgml
diff -u phpdoc/language/functions.sgml:1.5 phpdoc/language/functions.sgml:1.6
--- phpdoc/language/functions.sgml:1.5 Sat Jul 31 21:23:47 1999
+++ phpdoc/language/functions.sgml Wed Oct 20 18:52:31 1999
@@ -14,15 +14,15 @@
return $retval;
}
</programlisting>
- </informalexample>
+ </informalexample></para>
<simpara>
Any valid PHP code may appear inside a function, even other
functions and <link linkend="keyword.class">class</link>
- definitions.
+ definitions.</simpara>
<simpara>
- Functions must be defined before they are referenced.
+ Functions must be defined before they are referenced.</simpara></sect1>
<sect1 id="functions.returning-values">
<title>Returning values</title>
@@ -38,7 +38,7 @@
}
echo square (4); // outputs '16'.
</programlisting>
- </informalexample>
+ </informalexample></para>
<para>
You can't return multiple values from a function, but similar
@@ -51,20 +51,18 @@
}
list ($zero, $one, $two) = small_numbers();
</programlisting>
- </informalexample>
+ </informalexample></para></sect1>
<sect1 id="functions.arguments">
<title>Function arguments</title>
<simpara>
Information may be passed to functions via the argument list,
- which is a comma-delimited list of variables and/or constants.
+ which is a comma-delimited list of variables and/or constants.</simpara>
<para>
- PHP supports passing arguments by value (the default), <link
- linkend="functions.arguments.by-reference">passing by
- reference</link>, and <link
- linkend="functions.arguments.default">default argument
+ PHP supports passing arguments by value (the default), <link
linkend="functions.arguments.by-reference">passing by
+ reference</link>, and <link
linkend="functions.arguments.default">default argument
values</link>. Variable-length argument lists are not supported,
but a similar effect may be obtained by passing arrays.
@@ -74,7 +72,7 @@
echo "$input[0] + $input[1] = ", $input[0]+$input[1];
}
</programlisting>
- </informalexample>
+ </informalexample></para>
<sect2 id="functions.arguments.by-reference">
<title>Making arguments be passed by reference</title>
@@ -84,7 +82,7 @@
if you change the value of the argument within the function,
it does not get changed outside of the function). If you wish
to allow a function to modify its arguments, you must pass them
- by reference.
+ by reference.</simpara>
<para>
If you want an argument to a function to always be passed by
@@ -100,7 +98,7 @@
add_some_extra($str);
echo $str; // outputs 'This is a string, and something extra.'
</programlisting>
- </informalexample>
+ </informalexample></para>
<para>
If you wish to pass a variable by reference to a function which
@@ -118,7 +116,7 @@
foo (&$str);
echo $str; // outputs 'This is a string, and something extra.'
</programlisting>
- </informalexample>
+ </informalexample></para></sect2>
<sect2 id="functions.arguments.default">
<title>Default argument values</title>
@@ -135,7 +133,7 @@
echo makecoffee ();
echo makecoffee ("espresso");
</programlisting>
- </informalexample>
+ </informalexample></para>
<para>
The output from the above snippet is:
@@ -143,16 +141,16 @@
<screen>
Making a cup of cappucino.
Making a cup of espresso.
- </screen>
+ </screen></para>
<simpara>
The default value must be a constant expression, not (for
- example) a variable or class member.
+ example) a variable or class member.</simpara>
<para>
In PHP 4.0 it's also possible to specify <literal>unset</literal>
for default argument. This means that the argument will not be
- set at all, if a value is not supplied.
+ set at all, if a value is not supplied.</para>
<para>
Note that when using default arguments, any defaults should be
@@ -168,7 +166,7 @@
echo makeyogurt ("raspberry"); // won't work as expected
</programlisting>
- </informalexample>
+ </informalexample></para>
<para>
The output of the above example is:
@@ -177,7 +175,7 @@
Warning: Missing argument 2 in call to makeyogurt() in
/usr/local/etc/httpd/htdocs/php3test/functest.html on line 41
Making a bowl of raspberry .
- </screen>
+ </screen></para>
<para>
Now, compare the above with this:
@@ -190,14 +188,14 @@
echo makeyogurt ("raspberry"); // works as expected
</programlisting>
- </informalexample>
+ </informalexample></para>
<para>
The output of this example is:
<screen>
Making a bowl of acidophilus raspberry.
- </screen>
+ </screen></para></sect2></sect1>
<sect1 id="functions.old-syntax">
<title><literal>old_function</literal></title>
@@ -205,10 +203,10 @@
<simpara>
The <literal>old_function</literal> statement allows you to declare
a function using a syntax identical to PHP/FI2 (except you must
- replace 'function' with 'old_function'.
+ replace 'function' with 'old_function'.</simpara>
<simpara>
This is a deprecated feature, and should only be used by the
- PHP/FI2->PHP3 convertor.
+ PHP/FI2->PHP3 convertor.</simpara>
<warning>
<para>
Functions declared as <literal>old_function</literal>
@@ -219,7 +217,7 @@
this limitation by writing a wrapper function (in normal PHP3 form)
to call the <literal>old_function</literal>.
</para>
- </warning>
+ </warning></sect1>
</chapter>
Index: phpdoc/language/oop.sgml
diff -u phpdoc/language/oop.sgml:1.2 phpdoc/language/oop.sgml:1.3
--- phpdoc/language/oop.sgml:1.2 Sat Aug 28 21:14:11 1999
+++ phpdoc/language/oop.sgml Wed Oct 20 18:52:31 1999
@@ -8,7 +8,7 @@
these variables. A class is defined using the following syntax:
<informalexample>
- <programlisting role=php>
+ <programlisting role="php">
<?php
class Cart {
var $items; // Items in our shopping cart
@@ -32,7 +32,7 @@
}
?>
</programlisting>
- </informalexample>
+ </informalexample></para>
<para>
This defines a class named Cart that consists of an associative
@@ -46,7 +46,7 @@
</para>
<informalexample>
- <programlisting role=php>
+ <programlisting role="php">
$cart = new Cart;
$cart->add_item("10", 1);
</programlisting>
@@ -64,7 +64,7 @@
</para>
<informalexample>
- <programlisting role=php>
+ <programlisting role="php">
class Named_Cart extends Cart {
var $owner;
@@ -84,7 +84,7 @@
</para>
<informalexample>
- <programlisting role=php>
+ <programlisting role="php">
$ncart = new Named_Cart; // Create a named cart
$ncart->set_owner ("kris"); // Name that cart
print $ncart->owner; // print the cart owners name
@@ -105,7 +105,7 @@
</para>
<informalexample>
- <programlisting role=php>
+ <programlisting role="php">
class Auto_Cart extends Cart {
function Auto_Cart () {
$this->add_item ("10", 1);
@@ -123,7 +123,7 @@
</para>
<informalexample>
- <programlisting role=php>
+ <programlisting role="php">
class Constructor_Cart {
function Constructor_Cart ($item = "10", $num = 1) {
$this->add_item ($item, $num);
@@ -143,8 +143,8 @@
<caution>
<simpara>
For derived classes, the constructor of the parent class is not
- automatically called when the derived class's constructor is called.
- </caution>
+ automatically called when the derived class's constructor is called.</simpara>
+ </caution></sect1>
</chapter>
Index: phpdoc/language/operators.sgml
diff -u phpdoc/language/operators.sgml:1.2 phpdoc/language/operators.sgml:1.3
--- phpdoc/language/operators.sgml:1.2 Sat Jul 31 20:39:46 1999
+++ phpdoc/language/operators.sgml Wed Oct 20 18:52:31 1999
@@ -57,7 +57,7 @@
strings that get converted to integers). If either operand is a
floating-point value, floating-point division is performed.
</simpara>
--->
+--></sect1>
<sect1 id="language.operators.string">
<title>String Operators</title>
@@ -70,7 +70,7 @@
$a = "Hello ";
$b = $a . "World!"; // now $b = "Hello World!"
</programlisting></informalexample>
- </para>
+ </para></sect1>
<sect1 id="language.operators.assignment">
<title>Assignment Operators</title>
@@ -97,7 +97,7 @@
$b = "Hello ";
$b .= "There!"; // sets $b to "Hello There!", just like $b = $b .
"There!";
</programlisting></informalexample>
- </para>
+ </para></sect1>
<sect1 id="language.operators.bitwise">
<title>Bitwise Operators</title>
@@ -149,7 +149,7 @@
</row>
</tbody>
</tgroup>
- </table>
+ </table></sect1>
<sect1 id="language.operators.logical">
<title>Logical Operators</title>
@@ -202,7 +202,7 @@
<simpara>
The reason for the two different variations of "and" and "or"
operators is that they operate at different precedences. (See below.)
- </simpara>
+ </simpara></sect1>
<sect1 id="language.operators.comparison">
<title>Comparison Operators</title>
@@ -262,7 +262,7 @@
<informalexample><programlisting>(expr1) ? (expr2) :
(expr3);</programlisting></informalexample>
This expression returns to <replaceable>expr2</replaceable> if
<replaceable>expr1</replaceable> evalutes to true, and expr3 if
- <replaceable>expr1</replaceable> evaluates to false.
+ <replaceable>expr1</replaceable> evaluates to false.</para></sect1>
<sect1 id="language.operators.precedence">
<title>Operator Precedence</title>
@@ -271,7 +271,7 @@
two expressions together. For example, in the expression
<literal>1 + 5 * 3</literal>, the answer is 16 and not
18 because the multiplication ("*") operator has a higher precedence
- than the addition ("+") operator.
+ than the addition ("+") operator.</para>
<para>
The following table lists the precedence of operators with the
lowest-precedence operators listed first.
@@ -368,7 +368,7 @@
</row>
</tbody>
</tgroup>
- </table>
+ </table></para></sect1>
</chapter>
Index: phpdoc/language/types.sgml
diff -u phpdoc/language/types.sgml:1.3 phpdoc/language/types.sgml:1.4
--- phpdoc/language/types.sgml:1.3 Mon Sep 27 14:22:21 1999
+++ phpdoc/language/types.sgml Wed Oct 20 18:52:31 1999
@@ -5,29 +5,27 @@
PHP supports the following types:
<itemizedlist>
- <listitem><simpara><link
linkend="language.types.integer">integer</link>
- <listitem><simpara><link
linkend="language.types.double">floating-point numbers</link>
- <listitem><simpara><link
linkend="language.types.string">string</link>
- <listitem><simpara><link
linkend="language.types.array">array</link>
- <listitem><simpara><link
linkend="language.types.object">object</link>
- </itemizedlist>
+ <listitem><simpara><link
linkend="language.types.integer">integer</link></simpara></listitem>
+ <listitem><simpara><link
linkend="language.types.double">floating-point
numbers</link></simpara></listitem>
+ <listitem><simpara><link
linkend="language.types.string">string</link></simpara></listitem>
+ <listitem><simpara><link
linkend="language.types.array">array</link></simpara></listitem>
+ <listitem><simpara><link
linkend="language.types.object">object</link></simpara></listitem>
+ </itemizedlist></para>
<simpara>
The type of a variable is usually not set by the programmer;
rather, it is decided at runtime by PHP depending on the context
- in which that variable is used.
+ in which that variable is used.</simpara>
<simpara>
If you would like to force a variable to be converted to a certain
- type, you may either <link
- linkend="language.types.typecasting">cast</link> the variable or use
- the <function>settype</function> function on it.
+ type, you may either <link
linkend="language.types.typecasting">cast</link> the variable or use
+ the <function>settype</function> function on it.</simpara>
<simpara>
Note that a variable may behave in different manners in certain
- situations, depending on what type it is a the time. For more
- information, see the section on <link
- linkend="language.types.type-juggling">Type Juggling</link>.
+ situations, depending on what type it is at the time. For more
+ information, see the section on <link
linkend="language.types.type-juggling">Type Juggling</link>.</simpara>
<sect1 id="language.types.integer">
<title>Integers</title>
@@ -38,7 +36,7 @@
$a = -123; # a negative number
$a = 0123; # octal number (equivalent to 83 decimal)
$a = 0x12; # hexadecimal number (equivalent to 18 decimal)
-</programlisting></informalexample>
+</programlisting></informalexample></para></sect1>
<sect1 id="language.types.double">
<title>Floating point numbers</title>
@@ -48,12 +46,12 @@
<informalexample><programlisting>
$a = 1.234;
$a = 1.2e3;
-</programlisting></informalexample>
+</programlisting></informalexample></para></sect1>
<sect1 id="language.types.string">
<title>Strings</title>
<para>
- Strings can be specified using one of two sets of delimiters.
+ Strings can be specified using one of two sets of delimiters.</para>
<para>
If the string is enclosed in double-quotes ("), variables
within the string will be expanded (subject to some parsing
@@ -109,27 +107,27 @@
</row>
</tbody>
</tgroup>
- </table>
+ </table></para>
<para>
You can escape any other character, but a warning will be issued
- at the highest warning level.
+ at the highest warning level.</para>
<para>
The second way to delimit a string uses the single-quote ("'")
character, which does not do any variable expansion or backslash
processing (except for "\\" and "\'" so you can insert backslashes
- and single-quotes in a singly-quoted string).
+ and single-quotes in a singly-quoted string).</para>
<sect2 id="language.types.string.conversion">
<title>String conversion</title>
<simpara>
When a string is evaluated as a numeric value, the resulting
- value and type are determined as follows.
+ value and type are determined as follows.</simpara>
<simpara>
The string will evaluate as a double if it contains any of the
characters '.', 'e', or 'E'. Otherwise, it will evaluate as an
- integer.
+ integer.</simpara>
<para>
The value is given by the initial portion of the string. If the
@@ -138,11 +136,11 @@
is an optional sign, followed by one or more digits (optionally
containing a decimal point), followed by an optional
exponent. The exponent is an 'e' or 'E' followed by one or more
- digits.
+ digits.</para>
<simpara>
When the first expression is a string, the type of the variable
- will depend on the second expression.
+ will depend on the second expression.</simpara>
<informalexample>
<programlisting>
@@ -159,14 +157,14 @@
<simpara>
For more information on this conversion, see the Unix manual
- page for strtod(3).
+ page for strtod(3).</simpara></sect2></sect1>
<sect1 id="language.types.array">
<title>Arrays</title>
<para>
Arrays actually act like both hash tables (associative arrays)
- and indexed arrays (vectors).
+ and indexed arrays (vectors).</para>
<sect2 id="language.types.array.single-dim">
<title>Single Dimension Arrays</title>
@@ -183,7 +181,7 @@
$a[1] = "def";
$b["foo"] = 13;
</programlisting>
- </informalexample>
+ </informalexample></para>
<para>
You can also create an array by simply adding values to
@@ -194,7 +192,7 @@
$a[] = "hello"; // $a[2] == "hello"
$a[] = "world"; // $a[3] == "world"
</programlisting>
- </informalexample>
+ </informalexample></para>
<para>
Arrays may be sorted using the <function>asort</function>,
@@ -202,17 +200,17 @@
<function>rsort</function>, <function>sort</function>,
<function>uasort</function>, <function>usort</function>, and
<function>uksort</function> functions depending on the type of
- sort you want.
+ sort you want.</para>
<para>
You can count the number of items in an array using the
- <function>count</function> function.
+ <function>count</function> function.</para>
<para>
You can traverse an array using <function>next</function> and
<function>prev</function> functions. Another common way to
traverse an array is to use the <function>each</function>
- function.
+ function.</para></sect2>
<sect2 id="language.types.array.multi-dim">
<title>Multi-Dimensional Arrays</title>
@@ -232,7 +230,7 @@
$a["foo"][4]["bar"][0] = $f; # four dimensional!
</programlisting>
- </informalexample>
+ </informalexample></para>
<para>
You can "fill up" multi-dimensional arrays in many ways,
@@ -261,7 +259,7 @@
3 => 4
);
</programlisting>
- </informalexample>
+ </informalexample></para>
<para>
The <function>array</function> function can be nested for
@@ -291,7 +289,7 @@
echo $a["apple"]["taste"]; # will output "sweet"
?>
</programlisting>
- </informalexample>
+ </informalexample></para></sect2></sect1>
<sect1 id="language.types.object">
<title>Objects</title>
@@ -312,9 +310,9 @@
}
$bar = new foo;
-$bar -> do_foo ();
+$bar->do_foo();
</programlisting>
- </informalexample>
+ </informalexample></para></sect2></sect1>
<sect1 id="language.types.type-juggling">
<title>Type juggling</title>
@@ -326,7 +324,7 @@
assign a string value to variable <parameter>var</parameter>,
<parameter>var</parameter> becomes a string. If you then assign
an integer value to <parameter>var</parameter>, it becomes an
- integer.
+ integer.</simpara>
<para>
An example of PHP's automatic type conversion is the addition
@@ -346,18 +344,16 @@
$foo = 5 + "10 Little Piggies"; // $foo is integer (15)
$foo = 5 + "10 Small Pigs"; // $foo is integer (15)
</programlisting>
- </informalexample>
+ </informalexample></para>
<simpara>
- If the last two examples above seem odd, see <link
- linkend="language.types.string.conversion">String conversion</link>.
+ If the last two examples above seem odd, see <link
linkend="language.types.string.conversion">String
conversion</link>.</simpara>
<simpara>
If you wish to force a variable to be evaluated as a certain
- type, see the section on <link
- linkend="language.types.typecasting">Type casting</link>. If you
+ type, see the section on <link linkend="language.types.typecasting">Type
casting</link>. If you
wish to change the type of a variable, see
- <function>settype</function>.
+ <function>settype</function>.</simpara>
<sect2 id="language.types.typecasting">
<title>Type casting</title>
@@ -372,17 +368,17 @@
$foo = 10; // $foo is an integer
$bar = (double) $foo; // $bar is a double
</programlisting>
- </informalexample>
+ </informalexample></para>
<para>
The casts allowed are:
<itemizedlist>
- <listitem><simpara>(int), (integer) - cast to integer
- <listitem><simpara>(real), (double), (float) - cast to double
- <listitem><simpara>(string) - cast to string
- <listitem><simpara>(array) - cast to array
- <listitem><simpara>(object) - cast to object
- </itemizedlist>
+ <listitem><simpara>(int), (integer) - cast to
integer</simpara></listitem>
+ <listitem><simpara>(real), (double), (float) - cast to
double</simpara></listitem>
+ <listitem><simpara>(string) - cast to string</simpara></listitem>
+ <listitem><simpara>(array) - cast to array</simpara></listitem>
+ <listitem><simpara>(object) - cast to object</simpara></listitem>
+ </itemizedlist></para>
<para>
Note that tabs and spaces are allowed inside the parentheses, so
@@ -393,7 +389,16 @@
$foo = (int) $bar;
$foo = ( int ) $bar;
</programlisting>
- </informalexample>
+ </informalexample></para>
+
+ <para>
+ It may not be obvious exactly what will happen when casting
+ between certain types. For instance, the following should be
+ noted:
+
+
+
+ </para></sect2></sect1>
</chapter>
Index: phpdoc/language/variables.sgml
diff -u phpdoc/language/variables.sgml:1.2 phpdoc/language/variables.sgml:1.3
--- phpdoc/language/variables.sgml:1.2 Thu Jul 1 14:58:17 1999
+++ phpdoc/language/variables.sgml Wed Oct 20 18:52:31 1999
@@ -9,7 +9,7 @@
For the most part all PHP variables only have a single scope.
However, within user-defined functions a local function scope is
introduced. Any variable used inside a function is by default
- limited to the local function scope. For example:
+ limited to the local function scope. For example:</simpara>
<informalexample>
<programlisting>
@@ -32,7 +32,7 @@
overridden by a local definition. This can cause some problems in
that people may inadvertently change a global variable. In PHP
global variables must be declared global inside a function if they
- are going to be used in that function. An example:
+ are going to be used in that function. An example:</simpara>
<informalexample>
<programlisting>
@@ -54,12 +54,12 @@
The above script will output "3". By declaring $a and
$b global within the function, all references to either variable
will refer to the global version. There is no limit to the number
- of global variables that can be manipulated by a function.
+ of global variables that can be manipulated by a function.</simpara>
<simpara>
A second way to access variables from the global scope is to use
the special PHP-defined $GLOBALS array. The previous example can
- be rewritten as:
+ be rewritten as:</simpara>
<informalexample>
<programlisting>
@@ -78,14 +78,14 @@
<simpara>
The $GLOBALS array is an associative array with the name of the
global variable being the key and the contents of that variable
- being the value of the array element.
+ being the value of the array element.</simpara>
<simpara>
Another important feature of variable scoping is the
<emphasis>static</emphasis> variable. A static variable exists
only in a local function scope, but it does not lose its value
when program execution leaves this scope. Consider the following
- example:
+ example:</simpara>
<informalexample>
<programlisting>
@@ -103,7 +103,7 @@
the variable serves no purpose since as soon as the function exits
the $a variable disappears. To make a useful counting function
which will not lose track of the current count, the $a variable is
- declared static:
+ declared static:</simpara>
<informalexample>
<programlisting>
@@ -117,7 +117,7 @@
<simpara>
Now, every time the Test() function is called it will print the
- value of $a and increment it.
+ value of $a and increment it.</simpara>
<simpara>
Static variables are also essential when functions are called
@@ -125,7 +125,7 @@
Care must be taken when writing a recursive function because it is
possible to make it recurse indefinitely. You must make sure you
have an adequate way of terminating the recursion. The following
- simple function recursively counts to 10:
+ simple function recursively counts to 10:</simpara>
<informalexample>
<programlisting>
@@ -140,7 +140,7 @@
$count--;
}
</programlisting>
- </informalexample>
+ </informalexample></sect1>
<sect1 id="language.variables.variable">
<title>Variable variables</title>
@@ -148,7 +148,7 @@
<simpara>
Sometimes it is convenient to be able to have variable variable
names. That is, a variable name which can be set and used
- dynamically. A normal variable is set with a statement such as:
+ dynamically. A normal variable is set with a statement such as:</simpara>
<informalexample>
<programlisting>
@@ -159,7 +159,7 @@
<simpara>
A variable variable takes the value of a variable and treats that as the
name of a variable. In the above example, <emphasis>hello</emphasis>, can
- be used as the name of a variable by using two dollar signs. ie.
+ be used as the name of a variable by using two dollar signs. ie.</simpara>
<informalexample>
<programlisting>
@@ -170,7 +170,7 @@
<simpara>
At this point two variables have been defined and stored in the
PHP symbol tree: $a with contents "hello" and $hello with contents
- "world". Therefore, this statement:
+ "world". Therefore, this statement:</simpara>
<informalexample>
<programlisting>
@@ -179,7 +179,7 @@
</informalexample>
<simpara>
- produces the exact same output as:
+ produces the exact same output as:</simpara>
<informalexample>
<programlisting>
@@ -188,7 +188,7 @@
</informalexample>
<simpara>
- ie. they both produce: <emphasis>hello world</emphasis>.
+ ie. they both produce: <emphasis>hello world</emphasis>.</simpara>
<simpara>
In order to use variable variables with arrays, you have to
@@ -196,7 +196,7 @@
the parser needs to know if you meant to use $a[1] as a variable,
or if you wanted $$a as the variable and then the [1] index from
that variable. The syntax for resolving this ambiguity is:
- ${$a[1]} for the first case and ${$a}[1] for the second.
+ ${$a[1]} for the first case and ${$a}[1] for the second.</simpara></sect1>
<sect1 id="language.variables.external">
<title>Variables from outside PHP</title>
@@ -207,7 +207,7 @@
<simpara>
When a form is submitted to a PHP script, any variables from that
form will be automatically made available to the script by
- PHP. For instance, consider the following form:
+ PHP. For instance, consider the following form:</simpara>
<para>
<example>
@@ -218,19 +218,19 @@
<input type="submit">
</form>
</programlisting>
- </example>
+ </example></para>
<simpara>
When submitted, PHP will create the variable
<computeroutput>$name</computeroutput>, which will will contain
whatever what entered into the <emphasis>Name:</emphasis> field
- on the form.
+ on the form.</simpara>
<simpara>
PHP also understands arrays in the context of form variables, but
only in one dimension. You may, for example, group related
variables together, or use this feature to retrieve values from a
- multiple select input:
+ multiple select input:</simpara>
<para>
<example>
@@ -247,22 +247,21 @@
<input type="submit">
</form>
</programlisting>
- </example>
+ </example></para>
<simpara>
- If PHP's track_vars feature is turned on, either by the <link
- linkend="ini.track-vars">track_vars</link> configuration setting
+ If PHP's track_vars feature is turned on, either by the <link
linkend="ini.track-vars">track_vars</link> configuration setting
or the <computeroutput><?php_track_vars?></computeroutput>
directive, then variables submitted via the POST or GET methods
will also be found in the global associative arrays
- $HTTP_POST_VARS and $HTTP_GET_VARS as appropriate.
+ $HTTP_POST_VARS and $HTTP_GET_VARS as appropriate.</simpara>
<sect3>
- <title>IMAGE SUBMIT variable names</TITLE>
+ <title>IMAGE SUBMIT variable names</title>
<simpara>
When submitting a form, it is possible to use an image instead
- of the standard submit button with a tag like:
+ of the standard submit button with a tag like:</simpara>
<informalexample>
<programlisting>
@@ -277,14 +276,13 @@
the user click within the image. The experienced may note that
the actual variable names sent by the browser contains a period
rather than an underscore, but PHP converts the period to an
- underscore automatically.
+ underscore automatically.</simpara></sect3></sect2>
<sect2 id="language.variables.external.cookies">
<title>HTTP Cookies</title>
<simpara>
- PHP transparently supports HTTP cookies as defined by <ulink
- url="&spec.cookies;">Netscape's Spec</ulink>. Cookies are a
+ PHP transparently supports HTTP cookies as defined by <ulink
url="&spec.cookies;">Netscape's Spec</ulink>. Cookies are a
mechanism for storing data in the remote browser and thus
tracking or identifying return users. You can set cookies using
the <function>SetCookie</function> function. Cookies are part
@@ -292,11 +290,11 @@
before any output is sent to the browser. This is the same
restriction as for the <function>Header</function> function.
Any cookies sent to you from the client will automatically be
- turned into a PHP variable just like GET and POST method data.
+ turned into a PHP variable just like GET and POST method data.</simpara>
<simpara>
If you wish to assign multiple values to a single cookie, just
- add <emphasis>[]</emphasis> to the cookie name. For example:
+ add <emphasis>[]</emphasis> to the cookie name. For example:</simpara>
<informalexample>
<programlisting>
@@ -308,7 +306,7 @@
Note that a cookie will replace a previous cookie by the same
name in your browser unless the path or domain is different. So,
for a shopping cart application you may want to keep a counter
- and pass this along. i.e.
+ and pass this along. i.e.</simpara>
<example>
<title>SetCookie Example</title>
@@ -317,7 +315,7 @@
SetCookie ("Count", $Count, time()+3600);
SetCookie ("Cart[$Count]", $item, time()+3600);
</programlisting>
- </example>
+ </example></sect2>
<sect2 id="language.variables.external.environment">
<title>Environment variables</title>
@@ -330,7 +328,7 @@
<programlisting>
echo $HOME; /* Shows the HOME environment variable, if set. */
</programlisting>
- </informalexample>
+ </informalexample></para>
<para>
Since information coming in via GET, POST and Cookie mechanisms
@@ -339,7 +337,7 @@
sure that you are getting the right version. The
<function>getenv</function> function can be used for this. You
can also set an environment variable with the
- <function>putenv</function> function.
+ <function>putenv</function> function.</para></sect2>
<sect2>
<title>Determining variable types</title>
@@ -352,7 +350,7 @@
<function>gettype</function>, <function>is_long</function>,
<function>is_double</function>, <function>is_string</function>,
<function>is_array</function>, and
- <function>is_object</function>.
+ <function>is_object</function>.</para></sect2></sect1>
</chapter>