mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
- Note reordering and unrolling
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@131848 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
7dd3846683
commit
323ef98520
6 changed files with 56 additions and 68 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- splitted from ./en/functions/strings.xml, last change in rev 1.37 -->
|
||||
<refentry id="function.crc32">
|
||||
<refnamediv>
|
||||
|
@ -18,16 +18,14 @@
|
|||
to validate the integrity of data being transmitted.
|
||||
</para>
|
||||
<para>
|
||||
<note>
|
||||
<para>
|
||||
Because PHP's integer type is signed, and many crc32 checksums will
|
||||
result in negative integers, you need to use the "%u" formatter of
|
||||
<function>sprintf</function> or <function>printf</function> to get
|
||||
the string representation of the unsigned crc32 checksum.
|
||||
</para>
|
||||
</note>
|
||||
Because PHP's integer type is signed, and many crc32 checksums will
|
||||
result in negative integers, you need to use the "%u" formatter of
|
||||
<function>sprintf</function> or <function>printf</function> to get
|
||||
the string representation of the unsigned crc32 checksum.
|
||||
</para>
|
||||
<para>
|
||||
This second example shows how to print a converted checksum with the
|
||||
<function>printf</function> function :
|
||||
<function>printf</function> function:
|
||||
<example>
|
||||
<title>Displaying a crc32 checksum</title>
|
||||
<programlisting role="php">
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.10 $ -->
|
||||
<!-- $Revision: 1.11 $ -->
|
||||
<!-- splitted from ./en/functions/strings.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.echo">
|
||||
<refnamediv>
|
||||
|
@ -70,8 +70,11 @@ echo $some_var ? 'true': 'false'; // changing the statement around
|
|||
</example>
|
||||
</para>
|
||||
<para>
|
||||
<function>echo</function> also has a shortcut syntax, where you
|
||||
can immediately follow the opening tag with an equals sign.
|
||||
<function>echo</function> also has a shortcut syntax, where you can
|
||||
immediately follow the opening tag with an equals sign. This short syntax
|
||||
only works with the <link
|
||||
linkend="ini.short-open-tag">short_open_tag</link> configuration setting
|
||||
enabled.
|
||||
<informalexample>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
|
@ -80,13 +83,6 @@ I have <?=$foo?> foo.
|
|||
</programlisting>
|
||||
</informalexample>
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
This short syntax only works with the
|
||||
<link linkend="ini.short-open-tag">short_open_tag</link> configuration
|
||||
setting enabled.
|
||||
</para>
|
||||
</note>
|
||||
<simpara>
|
||||
For a short discussion about the differences between
|
||||
<function>print</function> and <function>echo</function>, see this FAQTs
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- splitted from ./en/functions/strings.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.explode">
|
||||
<refnamediv>
|
||||
|
@ -30,6 +30,13 @@
|
|||
in <parameter>string</parameter>, then <function>explode</function> will
|
||||
return an array containing <parameter>string</parameter>.
|
||||
</para>
|
||||
<para>
|
||||
Although <function>implode</function> can, for historical reasons,
|
||||
accept its parameters in either order,
|
||||
<function>explode</function> cannot. You must ensure that the
|
||||
<parameter>separator</parameter> argument comes before the
|
||||
<parameter>string</parameter> argument.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
The <parameter>limit</parameter> parameter was added in PHP
|
||||
|
@ -59,15 +66,6 @@ print $pass; // *
|
|||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
Although <function>implode</function> can, for historical reasons,
|
||||
accept its parameters in either order,
|
||||
<function>explode</function> cannot. You must ensure that the
|
||||
<parameter>separator</parameter> argument comes before the
|
||||
<parameter>string</parameter> argument.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
See also
|
||||
<function>preg_split</function>,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- splitted from ./en/functions/math.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.number-format">
|
||||
<refnamediv>
|
||||
|
@ -42,23 +42,21 @@
|
|||
the decimals and <parameter>thousands_sep</parameter> instead of
|
||||
a comma (",") between every group of thousands.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
Only the first character of <parameter>thousands_sep</parameter>
|
||||
is used. For example, if you use <literal>foo</literal> as
|
||||
<parameter>thousands_sep</parameter> on the number
|
||||
<literal>1000</literal>, <function>number_format</function> will
|
||||
return <literal>1f000</literal>.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
<example>
|
||||
<title><function>number_format</function> Example</title>
|
||||
<para>
|
||||
For instance, French notation usually use two decimals,
|
||||
comma (',') as decimal separator, and space (' ') as
|
||||
thousand separator. This is achieved with this line :
|
||||
</para>
|
||||
Only the first character of <parameter>thousands_sep</parameter>
|
||||
is used. For example, if you use <literal>foo</literal> as
|
||||
<parameter>thousands_sep</parameter> on the number
|
||||
<literal>1000</literal>, <function>number_format</function> will
|
||||
return <literal>1f000</literal>.
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title><function>number_format</function> Example</title>
|
||||
<para>
|
||||
For instance, French notation usually use two decimals,
|
||||
comma (',') as decimal separator, and space (' ') as
|
||||
thousand separator. This is achieved with this line :
|
||||
</para>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- splitted from ./en/functions/strings.xml, last change in rev 1.8 -->
|
||||
<refentry id="function.strrpos">
|
||||
<refnamediv>
|
||||
|
@ -25,13 +25,13 @@
|
|||
</para>
|
||||
<para>
|
||||
If <parameter>needle</parameter> is not found, returns &false;.
|
||||
<note>
|
||||
<para>
|
||||
It is easy to mistake the return values for "character found at
|
||||
position 0" and "character not found". Here's how to detect
|
||||
the difference:
|
||||
<informalexample>
|
||||
<programlisting role="php">
|
||||
</para>
|
||||
<para>
|
||||
It is easy to mistake the return values for "character found at
|
||||
position 0" and "character not found". Here's how to detect
|
||||
the difference:
|
||||
<informalexample>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
// in PHP 4.0b3 and newer:
|
||||
$pos = strrpos($mystring, "b");
|
||||
|
@ -45,10 +45,8 @@ if (is_string($pos) && !$pos) {
|
|||
// not found...
|
||||
}
|
||||
]]>
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
</para>
|
||||
</note>
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
</para>
|
||||
<para>
|
||||
If <parameter>needle</parameter> is not a string, it is converted
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- splitted from ./en/functions/strings.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.ucwords">
|
||||
<refnamediv>
|
||||
|
@ -18,6 +18,14 @@
|
|||
Returns a string with the first character of each word in
|
||||
<parameter>str</parameter> capitalized, if that character is
|
||||
alphabetic.
|
||||
</para>
|
||||
<simpara>
|
||||
The definition of a word is any string of characters
|
||||
that is immediately after a whitespace (These are:
|
||||
space, form-feed, newline, carriage return, horizontal tab,
|
||||
and vertical tab).
|
||||
</simpara>
|
||||
<para>
|
||||
<example>
|
||||
<title><function>ucwords</function> example</title>
|
||||
<programlisting role="php">
|
||||
|
@ -33,14 +41,6 @@ $bar = ucwords(strtolower($bar)); // Hello World!
|
|||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<note>
|
||||
<simpara>
|
||||
The definition of a word is any string of characters
|
||||
that is immediately after a whitespace (These are:
|
||||
space, form-feed, newline, carriage return, horizontal tab,
|
||||
and vertical tab).
|
||||
</simpara>
|
||||
</note>
|
||||
</para>
|
||||
<para>
|
||||
See also <function>strtoupper</function>,
|
||||
|
|
Loading…
Reference in a new issue