[doc-en] master: Fix typos and grammars in chapters directory (#5893)
| From: | Chun-Sheng, Li via GitHub | Date: | Tue, 29 Sep 2026 06:54:34 +0000 |
| Subject: | [doc-en] master: Fix typos and grammars in chapters directory (#5893) | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-23791@lists.php.net to get a copy of this message | ||
Author: Chun-Sheng, Li (peter279k)
Committer: GitHub (web-flow)
Pusher: lacatoire
Date: 2026-09-29T08:54:31+02:00
Commit: https://github.com/php/doc-en/commit/cd7a4b94a4cf282d8fd70803f0e2fdd159557444
Raw diff: https://github.com/php/doc-en/commit/cd7a4b94a4cf282d8fd70803f0e2fdd159557444.diff
Fix typos and grammars in chapters directory (#5893)
Changed paths:
M chapters/intro.xml
M chapters/tutorial.xml
Diff:
diff --git a/chapters/intro.xml b/chapters/intro.xml
index 76412b2abd13..e7bdd1565eca 100644
--- a/chapters/intro.xml
+++ b/chapters/intro.xml
@@ -99,7 +99,7 @@
<listitem>
<simpara>
Command line scripting. A PHP script can be run
- without any server or browser, only the
+ without any server or browser; only the
PHP parser is needed to use it this way.
This type of usage is ideal for scripts regularly
executed using <command>cron</command> (on Unix or macOS) or Task Scheduler (on
@@ -126,39 +126,39 @@
of using procedural programming or object-oriented
programming (OOP), or a mixture of them both.
</para>
- <para>
+ <simpara>
PHP is not limited to outputting HTML. PHP's abilities include
outputting rich file types, such as images or PDF files, encrypting data,
- and sending emails. It can also output easily any text, such as JSON
+ and sending emails. It can also easily output any text, such as JSON
or XML. PHP can autogenerate these files, and save them in the
- file system, instead of printing it out, forming a server-side cache for
+ filesystem, instead of printing them out, forming a server-side cache for
dynamic content.
- </para>
- <para>
+ </simpara>
+ <simpara>
One of the strongest and most significant features in PHP is its
support for a <link linkend="refs.database">wide range of
databases</link>.
Writing a database-enabled web page is incredibly simple using one of
- the database specific extensions (e.g., for <link
linkend="book.mysqli">mysql</link>),
+ the database specific extensions (e.g., for <link
linkend="book.mysqli">MySQL</link>),
or using an abstraction layer like <link linkend="book.pdo">PDO</link>,
or connect
to any database supporting the Open Database Connection standard via the
<link linkend="book.uodbc">ODBC</link> extension. Other databases may
utilize
<link linkend="book.curl">cURL</link> or <link
linkend="book.sockets">sockets</link>,
like CouchDB.
- </para>
+ </simpara>
<simpara>
PHP also has support for talking to other services using protocols
such as LDAP, IMAP, SNMP, NNTP, POP3, HTTP, COM (on Windows) and
countless others. It can also open raw network sockets and
interact using any other protocol.
</simpara>
- <para>
+ <simpara>
PHP has useful <link linkend="refs.basic.text">text processing</link>
features,
- which includes the Perl compatible regular expressions (<link
linkend="book.pcre">PCRE</link>),
+ which include the Perl compatible regular expressions (<link
linkend="book.pcre">PCRE</link>),
and many extensions and tools to <link linkend="refs.xml">parse and access XML
documents</link>.
PHP standardizes all of the XML extensions on the solid base of <link
linkend="book.libxml">libxml2</link>,
- and extends the feature set adding <link
linkend="book.simplexml">SimpleXML</link>,
+ and extends the feature set by adding <link
linkend="book.simplexml">SimpleXML</link>,
<link linkend="book.xmlreader">XMLReader</link> and <link
linkend="book.xmlwriter">XMLWriter</link> support.
- </para>
+ </simpara>
<para>
And many other interesting extensions exist, which are categorized both
<link linkend="extensions">alphabetically</link> and by <link
linkend="funcref">category</link>.
diff --git a/chapters/tutorial.xml b/chapters/tutorial.xml
index 735965b6e7a9..fa48917c0637 100644
--- a/chapters/tutorial.xml
+++ b/chapters/tutorial.xml
@@ -102,63 +102,63 @@ php -S localhost:8000
a set of special tags available to you that do a lot of interesting things.
</para>
- <para>
+ <simpara>
The point of the example is to show the special PHP tag format.
In this example we used <literal><?php</literal> to indicate the
start of a PHP tag. Then we put the PHP statement and left PHP mode by
adding the closing tag, <literal>?></literal>. You may jump in
- and out of PHP mode in an HTML file like this anywhere you want. For more
+ and out of PHP mode in an HTML file like this anywhere you want. For more
details, read the manual section on the <link linkend="language.basic-syntax">
basic PHP syntax</link>.
- </para>
+ </simpara>
<note>
<info><title>A Note on Line Feeds</title></info>
- <para>
- Line feeds have little meaning in HTML, however it is still a good idea
- to make your HTML look nice and clean by putting line feeds in. A
- linefeed that follows immediately after a closing
- <literal>?></literal> will be removed by PHP. This can be extremely
+ <simpara>
+ Line feeds have little meaning in HTML; however, it is still a good idea
+ to make your HTML look nice and clean by putting line feeds in. A
+ line feed that follows immediately after a closing
+ <literal>?></literal> will be removed by PHP. This can be extremely
useful when you are putting in many blocks of PHP or include files
- containing PHP that aren't supposed to output anything. At the same time
- it can be a bit confusing. You can put a space after the closing
+ containing PHP that aren't supposed to output anything. At the same time
+ it can be a bit confusing. You can put a space after the closing
<literal>?></literal> to force a space and a line feed to be output,
or you can put an explicit line feed in the last echo/print from within
your PHP block.
- </para>
+ </simpara>
</note>
<note>
<info><title>A Note on Text Editors</title></info>
- <para>
+ <simpara>
There are many text editors and Integrated Development Environments (IDEs)
that you can use to create, edit and manage PHP files. A partial list of
these tools is maintained at <link xlink:href="&url.phpeditorlist;">PHP
Editors
List</link>. If you wish to recommend an editor, please visit the above
- page and ask the page maintainer to add the editor to the list. Having
+ page and ask the page maintainer to add the editor to the list. Having
an editor with syntax highlighting can be helpful.
- </para>
+ </simpara>
</note>
<note>
<info><title>A Note on Word Processors</title></info>
- <para>
- Word processors such as StarOffice Writer, Microsoft Word and Abiword are
- not optimal for editing PHP files. If you wish to use one for this
+ <simpara>
+ Word processors such as StarOffice Writer, Microsoft Word and AbiWord are
+ not optimal for editing PHP files. If you wish to use one for this
test script, you must ensure that you save the file as <emphasis>plain
text</emphasis> or PHP will not be able to read and execute the script.
- </para>
+ </simpara>
</note>
- <para>
+ <simpara>
Now that you have successfully created a working PHP script, it is
- time to create the most famous PHP script! Make a call to the
+ time to create the most famous PHP script! Make a call to the
<function>phpinfo</function> function and you will see a lot of useful
information about your system and setup such as available
<link linkend="language.variables.predefined">predefined
variables</link>,
loaded PHP modules, and <link
linkend="configuration">configuration</link>
settings. Take some time and review this important information.
- </para>
+ </simpara>
<para>
<example>
<info><title>Get system information from PHP</title></info>
@@ -220,12 +220,12 @@ Mozilla/5.0 (Linux) Firefox/112.0
</screen>
</example>
</para>
- <para>
+ <simpara>
There are many <link linkend="language.types">types</link> of
- variables available in PHP. In the above example we printed an element
+ variables available in PHP. In the above example we printed an element
from an <link linkend="language.types.array">Array</link> variable.
Arrays can be very useful.
- </para>
+ </simpara>
<para>
<varname>$_SERVER</varname> is just one variable that PHP automatically
makes available to you. A list can be seen in the
@@ -274,12 +274,12 @@ You are using Firefox.
couple of chapters, or read the <link linkend="langref">Language
Reference</link> part of the manual.
</para>
- <para>
+ <simpara>
The second concept we introduced was the <function>str_contains</function>
function call. <function>str_contains</function> is a function built into
PHP which determines if a given string contains another string. In this case we are
looking for <literal>'Firefox'</literal> (so-called needle) inside
- <varname>$_SERVER['HTTP_USER_AGENT']</varname> (so-called haystack). If
+ <varname>$_SERVER['HTTP_USER_AGENT']</varname> (so-called haystack). If
the needle is found inside the haystack, the function returns true. Otherwise, it
returns &false;. If it returns &true;, the <link
linkend="control-structures.if">if</link> expression evaluates to &true;
@@ -288,12 +288,12 @@ You are using Firefox.
with <link linkend="control-structures.if">if</link>,
<link linkend="control-structures.else">else</link>, and other
functions such as <function>strtoupper</function> and
- <function>strlen</function>. Each related manual page contains examples
- too. If you are unsure how to use functions, you will want to read both
+ <function>strlen</function>. Each related manual page contains examples
+ too. If you are unsure how to use functions, you will want to read both
the manual page on <link linkend="about.prototypes">how to read a
function definition</link> and the section about
<link linkend="language.functions">PHP functions</link>.
- </para>
+ </simpara>
<para>
We can take this a step further and show how you can jump in and out
of PHP mode even in the middle of a PHP block:
@@ -329,27 +329,27 @@ if (str_contains($_SERVER['HTTP_USER_AGENT'], 'Firefox'))
{
</screen>
</example>
</para>
- <para>
+ <simpara>
Instead of using a PHP echo statement to output something, we jumped out
of PHP mode and just sent straight HTML. The important and powerful point
to note here is that the logical flow of the script remains intact. Only
one of the HTML blocks will end up getting sent to the viewer depending on
- the result of <function>str_contains</function>. In other words, it depends on
+ the result of <function>str_contains</function>. In other words, it depends on
whether the string <literal>Firefox</literal> was found or not.
- </para>
+ </simpara>
</section>
<section xml:id="tutorial.forms">
<info><title>Dealing with Forms</title></info>
- <para>
+ <simpara>
One of the most powerful features of PHP is the way it handles HTML
forms. The basic concept that is important to understand is that any
form element will automatically be available to your PHP
- scripts. Please read the manual section on
+ scripts. Please read the manual section on
<link linkend="language.variables.external">Variables from external
sources</link> for more information and examples on using forms
- with PHP. Here is an example HTML form:
- </para>
+ with PHP. Here is an example HTML form:
+ </simpara>
<para>
<example>
<info><title>A simple HTML form</title></info>
@@ -393,28 +393,28 @@ Hi Joe. You are 22 years old.
</screen>
</example>
</para>
- <para>
+ <simpara>
Apart from the <function>htmlspecialchars</function> and
<literal>(int)</literal> parts, it should be obvious what this does.
<function>htmlspecialchars</function> makes sure any characters that are
- special in html are properly encoded so people can't inject HTML tags
- or Javascript into your page. For the age field, since we know it is a
+ special in HTML are properly encoded so people can't inject HTML tags
+ or JavaScript into your page. For the age field, since we know it is a
number, we can just <link
linkend="language.types.typecasting">convert</link>
it to an <type>int</type> which will automatically get rid of any
- stray characters. You can also have PHP do this for you automatically by
+ stray characters. You can also have PHP do this for you automatically by
using the <link linkend="ref.filter">filter</link> extension.
The <varname>$_POST['name']</varname> and
<varname>$_POST['age']</varname>
- variables are automatically set for you by PHP. Earlier we
+ variables are automatically set for you by PHP. Earlier we
used the <varname>$_SERVER</varname> superglobal; above we just
introduced the <varname>$_POST</varname>
- superglobal which contains all POST data. Notice how the
- <emphasis>method</emphasis> of our form is POST. If we used the
+ superglobal which contains all POST data. Notice how the
+ <emphasis>method</emphasis> of our form is POST. If we used the
method <emphasis>GET</emphasis> then our form information would live in
the <varname>$_GET</varname> superglobal instead.
You may also use the <varname>$_REQUEST</varname>
superglobal, if you do not care about the source of your request data. It
contains the merged information of GET, POST and COOKIE data.
- </para>
+ </simpara>
</section>
<section xml:id="tutorial.whatsnext">