mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
include: minor textual changes.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@68160 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
7d338bb9e1
commit
fecbe442a9
1 changed files with 5 additions and 5 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.52 $ -->
|
||||
<!-- $Revision: 1.53 $ -->
|
||||
<chapter id="control-structures">
|
||||
<title>Control Structures</title>
|
||||
|
||||
|
@ -1098,7 +1098,7 @@ require ('somefile.txt');
|
|||
failure. <function>include</function> produces a
|
||||
<link linkend="internal.e-warning">Warning</link> while <function>require</function>
|
||||
results in a <link linkend="internal.e-error">Fatal Error</link>.
|
||||
In other words, don't hesitate to use <function>require</function> if you want
|
||||
In other words, use <function>require</function> if you want
|
||||
a missing file to halt processing of the page. <function>include</function> does
|
||||
not behave this way, the script will continue regardless. Be sure to have an
|
||||
appropriate <link linkend="ini.include-path">include_path</link> setting as well.
|
||||
|
@ -1292,7 +1292,7 @@ $var = 'PHP';
|
|||
|
||||
?>
|
||||
|
||||
getfoo.php
|
||||
testreturns.php
|
||||
<?php
|
||||
|
||||
$foo = include 'return.php';
|
||||
|
@ -1309,8 +1309,8 @@ echo $bar; // prints 1
|
|||
</example>
|
||||
</para>
|
||||
<simpara>
|
||||
<literal>$bar</literal> is the value (1) because the include was successful.
|
||||
Notice the difference between the above examples. The first uses
|
||||
<literal>$bar</literal> is the value <literal>1</literal> because the include
|
||||
was successful. Notice the difference between the above examples. The first uses
|
||||
<function>return</function> within the included file while the other does not.
|
||||
A few other ways to "include" files into variables are with
|
||||
<function>fopen</function>, <function>file</function> or by using
|
||||
|
|
Loading…
Reference in a new issue