sander Mon May 20 07:32:23 2002 EDT
Modified files:
/phpdoc-nl/reference/strings reference.xml
/phpdoc-nl/reference/strings/functions addslashes.xml crc32.xml
implode.xml join.xml
ltrim.xml md5.xml rtrim.xml
strcasecmp.xml strchr.xml
strcmp.xml strpos.xml
trim.xml wordwrap.xml
Log:
Add revision tags and sync with EN
Index: phpdoc-nl/reference/strings/reference.xml
diff -u phpdoc-nl/reference/strings/reference.xml:1.2
phpdoc-nl/reference/strings/reference.xml:1.3
--- phpdoc-nl/reference/strings/reference.xml:1.2 Tue Apr 16 20:03:06 2002
+++ phpdoc-nl/reference/strings/reference.xml Mon May 20 07:32:22 2002
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- EN-Revision: 1.3 Maintainer: sander Status: ready -->
<reference id="ref.strings">
<title>String functions</title>
<titleabbrev>Strings</titleabbrev>
@@ -9,12 +10,16 @@
Meer specifieke functies kunnen worden gevonden in de regular expression
en URL handling secties.
</simpara>
-
<para>
Voor informatie over hoe strings zich gedragen, vooral met betrekking tot
het gebruik van single quotes, double quotes en escape sequences, zie de
<link linkend="language.types.string">Strings</link> entry in de
<link linkend="language.types">Types</link> sectie van de manual.
+ </para>
+ <para>
+ Voor nog krachtigere manieren om strings te gebruiken en te manipuleren
+ zie ook de <link linkend="ref.regex">POSIX regular expression functies</link>
+ en de <link linkend="ref.pcre">Perl compatible regular expression
+functies</link>.
</para>
</partintro>
Index: phpdoc-nl/reference/strings/functions/addslashes.xml
diff -u phpdoc-nl/reference/strings/functions/addslashes.xml:1.1
phpdoc-nl/reference/strings/functions/addslashes.xml:1.2
--- phpdoc-nl/reference/strings/functions/addslashes.xml:1.1 Sun Apr 14 21:37:32
2002
+++ phpdoc-nl/reference/strings/functions/addslashes.xml Mon May 20 07:32:22
+2002
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- splitted from ./nl/functions/strings.xml, last change in rev 1.1 -->
-<!-- last change to 'addslashes' in en/ tree in rev 1.2 -->
+<!-- EN-Revision: 1.2 Maintainer: sander Status: ready -->
<refentry id="function.addslashes">
<refnamediv>
<refname>AddSlashes</refname>
@@ -18,6 +17,10 @@
single quote (<literal>'</literal>), double quote
(<literal>"</literal>), backslash (<literal>\</literal>)
en NUL (de &null; byte).
+ </para>
+ <para>
+ <link linkend="ini.magic-quotes-gpc">magic_quotes_gpc</link> staat
+ standaard AAN.
</para>
<para>
Zie ook <function>stripslashes</function>,
Index: phpdoc-nl/reference/strings/functions/crc32.xml
diff -u phpdoc-nl/reference/strings/functions/crc32.xml:1.1
phpdoc-nl/reference/strings/functions/crc32.xml:1.2
--- phpdoc-nl/reference/strings/functions/crc32.xml:1.1 Sun Apr 14 21:37:33 2002
+++ phpdoc-nl/reference/strings/functions/crc32.xml Mon May 20 07:32:22 2002
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- splitted from ./nl/functions/strings.xml, last change in rev 1.1 -->
-<!-- last change to 'crc32' in en/ tree in rev 1.37 -->
+<!-- EN-Revision: 1.2 Maintainer: sander Status: ready -->
<refentry id="function.crc32">
<refnamediv>
<refname>crc32</refname>
@@ -15,7 +14,7 @@
<para>
Genereert de cyclische redundancy checksum polynoom van 32-bit lengtes
van de <parameter>str</parameter>. Dit wordt doorgaans toegepast
- bij het valideren van de integriteit van verzonden data.
+ om de integreteit van de verzonden data te controleren.
</para>
<para>
Zie ook: <function>md5</function>
Index: phpdoc-nl/reference/strings/functions/implode.xml
diff -u phpdoc-nl/reference/strings/functions/implode.xml:1.1
phpdoc-nl/reference/strings/functions/implode.xml:1.2
--- phpdoc-nl/reference/strings/functions/implode.xml:1.1 Sun Apr 14 21:37:34
2002
+++ phpdoc-nl/reference/strings/functions/implode.xml Mon May 20 07:32:22 2002
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- splitted from ./nl/functions/strings.xml, last change in rev 1.1 -->
-<!-- last change to 'implode' in en/ tree in rev 1.2 -->
+<!-- EN-Revision: 1.2 Maintainer: sander Status: ready -->
<refentry id="function.implode">
<refnamediv>
<refname>implode</refname>
@@ -14,21 +13,22 @@
<methodparam><type>array</type><parameter>pieces</parameter></methodparam>
</methodsynopsis>
<para>
- Geeft een string terug die de string representatie van alle
- array elementen in dezelfde volgorde, met de glue string tussen
- elk element bevat.
+ Geeft een string terug die bestaat uit alle elementen uit de array
+ in ongewijzigde volgorde, met de glue string tussen elk element.
<example>
- <title><function>implode</function> example</title>
+ <title><function>implode</function> voorbeeld</title>
<programlisting role="php">
-$colon_separated = implode (":", $array);
+<![CDATA[
+$colon_separated = implode (";", $array);
+]]>
</programlisting>
</example>
</para>
<note>
<para>
<function>implode</function> kan, om historische redenen, haar parameters
- in willekeurige volgorde accepteren. Voor consistency met
- <function>explode</function>, echter, zou het minder verwarrend zijn
+ in willekeurige volgorde accepteren. Om consequent te zijn met
+ <function>explode</function>, is het echter minder verwarrend
als je de gedocumenteerde volgorde van de argumenten vasthoudt.
</para>
</note>
Index: phpdoc-nl/reference/strings/functions/join.xml
diff -u phpdoc-nl/reference/strings/functions/join.xml:1.1
phpdoc-nl/reference/strings/functions/join.xml:1.2
--- phpdoc-nl/reference/strings/functions/join.xml:1.1 Sun Apr 14 21:37:34 2002
+++ phpdoc-nl/reference/strings/functions/join.xml Mon May 20 07:32:22 2002
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- splitted from ./nl/functions/strings.xml, last change in rev 1.1 -->
-<!-- last change to 'join' in en/ tree in rev 1.2 -->
+<!-- EN-Revision: 1.2 Maintainer: sander Status: ready -->
<refentry id="function.join">
<refnamediv>
<refname>join</refname>
Index: phpdoc-nl/reference/strings/functions/ltrim.xml
diff -u phpdoc-nl/reference/strings/functions/ltrim.xml:1.1
phpdoc-nl/reference/strings/functions/ltrim.xml:1.2
--- phpdoc-nl/reference/strings/functions/ltrim.xml:1.1 Sun Apr 14 21:37:34 2002
+++ phpdoc-nl/reference/strings/functions/ltrim.xml Mon May 20 07:32:22 2002
@@ -1,11 +1,10 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- splitted from ./nl/functions/strings.xml, last change in rev 1.1 -->
-<!-- last change to 'ltrim' in en/ tree in rev 1.2 -->
+<!-- En-Revision: 1.2 Maintainer: sander Status: ready -->
<refentry id="function.ltrim">
<refnamediv>
<refname>ltrim</refname>
- <refpurpose>
- Stript whitespace van het begin van een string
+ <refpurpose>
+ Verwijdert whitespace van het begin van een string
</refpurpose>
</refnamediv>
<refsect1>
@@ -13,16 +12,88 @@
<methodsynopsis>
<type>string</type><methodname>ltrim</methodname>
<methodparam><type>string</type><parameter>str</parameter></methodparam>
+ <methodparam
+choice="opt"><type>string</type><parameter>charlist</parameter></methodparam>
</methodsynopsis>
+ <note>
+ <simpara>
+ Het optionele <parameter>charlist</parameter> parameter was
+ toegevoegd in PHP 4.1.0
+ </simpara>
+ </note>
<para>
- Deze functie stript whitespace van het begin van een string en
- geeft de gestripte string terug. De whitespace karakters die
- momenteel gestript worden zijn: "\n", "\r", "\t",
"\v", "\0",
- en normale space.
+ Deze functie verwijdert whitespace van het begin van een
+ string en geeft de nieuwe string terug.
+ Zonder het tweede parameter zal <function>ltrim</function> de volgende
+ tekens verwijderen:
+ <!-- sorted by importance. Printed 3 times: trim, ltrim, rtrim -->
+ <itemizedlist>
+ <listitem>
+ <simpara>
+ " " (<acronym>ASCII</acronym> <literal>32</literal>
+ (<literal>0x20</literal>)), een normale spatie.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ "\t" (<acronym>ASCII</acronym> <literal>9</literal>
+ (<literal>0x09</literal>)), een tab.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ "\n" (<acronym>ASCII</acronym> <literal>10</literal>
+ (<literal>0x0A</literal>)), een new line (line feed).
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ "\r" (<acronym>ASCII</acronym> <literal>13</literal>
+ (<literal>0x0D</literal>)), een carriage return.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ "\0" (<acronym>ASCII</acronym> <literal>0</literal>
+ (<literal>0x00</literal>)), een <literal>NUL</literal>-byte.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara> <!-- not \v, since not supported by PHP -->
+ "\x0B" (<acronym>ASCII</acronym> <literal>11</literal>
+ (<literal>0x0B</literal>)), een verticale tab.
+ </simpara>
+ </listitem>
+ </itemizedlist>
</para>
<para>
- Zie ook <function>chop</function>, <function>rtrim</function>, and
- <function>trim</function>.
+ Het is ook mogelijk de tekens die moeten worden verwijderd te
+ specificeren met de <parameter>charlist</parameter>.
+ Je kunt simpelweg alle tekens die moeten worden verwijderd opsommen.
+ Met <literal>..</literal> kan je een rij tekens specificeren.
+ </para>
+ <example>
+ <title>Voorbeeld van het gebruik van <function>ltrim</function></title>
+ <para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+
+$text = "\t\tDit zijn een paar woorden :) ... ";
+$trimmed = ltrim($text);
+// $trimmed = "Dit zijn een paar woorden :) ... "
+$trimmed = ltrim($text," \t.");
+// $trimmed = "Dit zijn een paar woorden :) ... "
+$clean = ltrim($binary,"\0x00..\0x1F");
+// verwijder de ASCII control characters van het begin van $binary
+// (van 0 tot en met 31)
+
+?>
+]]>
+ </programlisting>
+ </para>
+ </example>
+ <para>
+ Zie ook <function>trim</function> en <function>rtrim</function>.
</para>
</refsect1>
</refentry>
Index: phpdoc-nl/reference/strings/functions/md5.xml
diff -u phpdoc-nl/reference/strings/functions/md5.xml:1.1
phpdoc-nl/reference/strings/functions/md5.xml:1.2
--- phpdoc-nl/reference/strings/functions/md5.xml:1.1 Sun Apr 14 21:37:34 2002
+++ phpdoc-nl/reference/strings/functions/md5.xml Mon May 20 07:32:22 2002
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- splitted from ./nl/functions/strings.xml, last change in rev 1.1 -->
-<!-- last change to 'md5' in en/ tree in rev 1.135 -->
+<!-- EN-Revision: 1.2 Maintainer: sander Status: ready -->
<refentry id="function.md5">
<refnamediv>
<refname>md5</refname>
@@ -13,12 +12,13 @@
<methodparam><type>string</type><parameter>str</parameter></methodparam>
</methodsynopsis>
<para>
- Calculeert de MD5 hash van <parameter>str</parameter> gebruik makend
+ Berekent de MD5 hash van <parameter>str</parameter> gebruik makend
van het <ulink url="&url.rfc;rfc1321.html">RSA Data Security, Inc.
- MD5 Message-Digest Algorithm</ulink>.
+ MD5 Message-Digest Algorithm</ulink>, en geeft die hash terug.
+ De hash is een 32 tekens lang hexadecimaal nummer.
</para>
<para>
- Zie ook: <function>crc32</function>
+ Zie ook: <function>crc32</function> en <function>md5_file</function>
</para>
</refsect1>
</refentry>
Index: phpdoc-nl/reference/strings/functions/rtrim.xml
diff -u phpdoc-nl/reference/strings/functions/rtrim.xml:1.1
phpdoc-nl/reference/strings/functions/rtrim.xml:1.2
--- phpdoc-nl/reference/strings/functions/rtrim.xml:1.1 Sun Apr 14 21:37:35 2002
+++ phpdoc-nl/reference/strings/functions/rtrim.xml Mon May 20 07:32:22 2002
@@ -1,30 +1,99 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- splitted from ./nl/functions/strings.xml, last change in rev 1.1 -->
-<!-- last change to 'rtrim' in en/ tree in rev 1.31 -->
+<!-- En-Revision: 1.2 Maintainer: sander Status: ready -->
<refentry id="function.rtrim">
<refnamediv>
- <refname>rtrim</refname>
- <refpurpose>Verwijder nakomende whitespace.</refpurpose>
+ <refname>rtrim</refname>
+ <refpurpose>
+ Verwijdert whitespace van het eind van een string
+ </refpurpose>
</refnamediv>
<refsect1>
<title>Omschrijving</title>
<methodsynopsis>
- <type>string</type><methodname>rtrim</methodname>
- <methodparam><type>string</type><parameter>str</parameter></methodparam>
+ <type>string</type><methodname>rtrim</methodname>
+ <methodparam><type>string</type><parameter>str</parameter></methodparam>
+ <methodparam
+choice="opt"><type>string</type><parameter>charlist</parameter></methodparam>
</methodsynopsis>
+ <note>
+ <simpara>
+ Het optionele <parameter>charlist</parameter> parameter was
+ toegevoegd in PHP 4.1.0
+ </simpara>
+ </note>
<para>
- Geeft de argument string terug zonder nakomende whitespace, inclusief
- newlines. Deze functie is een alias voor <function>chop</function>.
- <example>
- <title><function>rtrim</function> example</title>
+ Deze functie verwijdert whitespace van het einde van een
+ string en geeft de nieuwe string terug.
+ Zonder het tweede parameter zal <function>rtrim</function> de volgende
+ tekens verwijderen:
+ <!-- sorted by importance. Printed 3 times: trim, ltrim, rtrim -->
+ <itemizedlist>
+ <listitem>
+ <simpara>
+ " " (<acronym>ASCII</acronym> <literal>32</literal>
+ (<literal>0x20</literal>)), een normale spatie.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ "\t" (<acronym>ASCII</acronym> <literal>9</literal>
+ (<literal>0x09</literal>)), een tab.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ "\n" (<acronym>ASCII</acronym> <literal>10</literal>
+ (<literal>0x0A</literal>)), een new line (line feed).
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ "\r" (<acronym>ASCII</acronym> <literal>13</literal>
+ (<literal>0x0D</literal>)), een carriage return.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ "\0" (<acronym>ASCII</acronym> <literal>0</literal>
+ (<literal>0x00</literal>)), een <literal>NUL</literal>-byte.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara> <!-- not \v, since not supported by PHP -->
+ "\x0B" (<acronym>ASCII</acronym> <literal>11</literal>
+ (<literal>0x0B</literal>)), een verticale tab.
+ </simpara>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Het is ook mogelijk de tekens die moeten worden verwijderd te
+ specificeren met de <parameter>charlist</parameter>.
+ Je kunt simpelweg alle tekens die moeten worden verwijderd opsommen.
+ Met <literal>..</literal> kan je een rij tekens specificeren.
+ </para>
+ <example>
+ <title>Voorbeeld van het gebruik van <function>rtrim</function></title>
+ <para>
<programlisting role="php">
-$trimmed = rtrim ($line);
+<![CDATA[
+<?php
+
+$text = "\t\tDit zijn een paar woorden :) ... ";
+$trimmed = rtrim($text);
+// $trimmed = "\t\tDit zijn een paar woorden :) ..."
+$trimmed = rtrim($text," \t.");
+// $trimmed = "\t\tDit zijn een paar woorden :)"
+$clean = rtrim($binary,"\0x00..\0x1F");
+// verwijder de ASCII control characters van het eind van $binary
+// (van 0 tot en met 31)
+
+?>
+]]>
</programlisting>
- </example>
- </para>
+ </para>
+ </example>
<para>
- Zie ook <function>trim</function>, <function>ltrim</function>, en
- <function>rtrim</function>.
+ Zie ook <function>ltrim</function> en <function>ltrim</function>.
</para>
</refsect1>
</refentry>
Index: phpdoc-nl/reference/strings/functions/strcasecmp.xml
diff -u phpdoc-nl/reference/strings/functions/strcasecmp.xml:1.1
phpdoc-nl/reference/strings/functions/strcasecmp.xml:1.2
--- phpdoc-nl/reference/strings/functions/strcasecmp.xml:1.1 Sun Apr 14 21:37:37
2002
+++ phpdoc-nl/reference/strings/functions/strcasecmp.xml Mon May 20 07:32:22
+2002
@@ -22,17 +22,20 @@
<example>
<title><function>strcasecmp</function> voorbeeld</title>
<programlisting role="php">
-$var1 = "Hallo";
-$var2 = "hallo";
+<![CDATA[
+$var1 = "Hallo";;
+$var2 = "hallo";
if (!strcasecmp ($var1, $var2)) {
echo '$var1 is gelijk aan $var2 in een hoofdletter ongevoelige string
vergelijking';
}
+]]>
</programlisting>
</example>
</para>
<simpara>
Zie ook <function>ereg</function>, <function>strcmp</function>,
- <function>substr</function>, <function>stristr</function>, en
+ <function>substr</function>, <function>stristr</function>,
+ <function>strncasecmp</function>, en
<function>strstr</function>.
</simpara>
</refsect1>
Index: phpdoc-nl/reference/strings/functions/strchr.xml
diff -u phpdoc-nl/reference/strings/functions/strchr.xml:1.1
phpdoc-nl/reference/strings/functions/strchr.xml:1.2
--- phpdoc-nl/reference/strings/functions/strchr.xml:1.1 Sun Apr 14 21:37:37
2002
+++ phpdoc-nl/reference/strings/functions/strchr.xml Mon May 20 07:32:22 2002
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- splitted from ./nl/functions/strings.xml, last change in rev 1.1 -->
-<!-- last change to 'strchr' in en/ tree in rev 1.2 -->
+<!-- EN-Revision: 1.2 Maintainer: sander Status: ready -->
<refentry id="function.strchr">
<refnamediv>
<refname>strchr</refname>
Index: phpdoc-nl/reference/strings/functions/strcmp.xml
diff -u phpdoc-nl/reference/strings/functions/strcmp.xml:1.1
phpdoc-nl/reference/strings/functions/strcmp.xml:1.2
--- phpdoc-nl/reference/strings/functions/strcmp.xml:1.1 Sun Apr 14 21:37:37
2002
+++ phpdoc-nl/reference/strings/functions/strcmp.xml Mon May 20 07:32:22 2002
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- splitted from ./nl/functions/strings.xml, last change in rev 1.1 -->
-<!-- last change to 'strcmp' in en/ tree in rev 1.2 -->
+<!-- EN-Revision: 1.2 Maintainer: sander Status: ready -->
<refentry id="function.strcmp">
<refnamediv>
<refname>strcmp</refname>
Index: phpdoc-nl/reference/strings/functions/strpos.xml
diff -u phpdoc-nl/reference/strings/functions/strpos.xml:1.1
phpdoc-nl/reference/strings/functions/strpos.xml:1.2
--- phpdoc-nl/reference/strings/functions/strpos.xml:1.1 Sun Apr 14 21:37:40
2002
+++ phpdoc-nl/reference/strings/functions/strpos.xml Mon May 20 07:32:22 2002
@@ -19,7 +19,7 @@
<para>
Geeft de numerieke positie van het eerste voorkomen van
<parameter>needle</parameter> in <parameter>haystack</parameter>.
- Verschillend van de <function>strrpos</function>, kan deze functie
+ In tegenstelling tot <function>strrpos</function>, kan deze functie
een hele string gebruiken als <parameter>needle</parameter> parameter,
die dan ook in zijn geheel gebruikt zal worden.
</para>
@@ -32,17 +32,19 @@
te detecteren:
<informalexample>
<programlisting role="php">
+<![CDATA[
// in PHP 4.0b3 en nieuwer:
-$pos = strpos ($mystring, "b");
-if ($pos === false) { // opmerking: drie equal signs
+$pos = strpos ($mystring, "b");
+if ($pos === false) { // opmerking: drie gelijk aan tekens
// niet gevonden...
}
// in versies ouder dan 4.0b3:
-$pos = strpos ($mystring, "b");
-if (is_string ($pos) && !$pos) {
+$pos = strpos ($mystring, "b");
+if (!is_integer($pos)) {
// niet gevonden...
}
+]]>
</programlisting>
</informalexample>
</para>
@@ -50,14 +52,14 @@
</para>
<para>
Als <parameter>needle</parameter> geen string is, zal die geconverteerd
- worden naar een integer en toegepast worden als de ordinale waarde van een
+ worden naar een integer en toegepast worden als de normale waarde van een
karakter.
</para>
<para>
De optionele <parameter>offset</parameter> parameter maakt het
mogelijk om te specifieren bij welk karakter in <parameter>haystack</parameter>
begonnen moet worden met zoeken. De positie die teruggegeven wordt is
- nog steeds relatief met het begin van <parameter>haystack</parameter>.
+ nog steeds relatief aan het begin van <parameter>haystack</parameter>.
</para>
<para>
Zie ook <function>strrpos</function>,
Index: phpdoc-nl/reference/strings/functions/trim.xml
diff -u phpdoc-nl/reference/strings/functions/trim.xml:1.1
phpdoc-nl/reference/strings/functions/trim.xml:1.2
--- phpdoc-nl/reference/strings/functions/trim.xml:1.1 Sun Apr 14 21:37:41 2002
+++ phpdoc-nl/reference/strings/functions/trim.xml Mon May 20 07:32:22 2002
@@ -1,11 +1,10 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- splitted from ./nl/functions/strings.xml, last change in rev 1.1 -->
-<!-- last change to 'trim' in en/ tree in rev 1.2 -->
+<!-- En-Revision: 1.2 Maintainer: sander Status: ready -->
<refentry id="function.trim">
<refnamediv>
<refname>trim</refname>
- <refpurpose>
- Stript whitespace van het begin en eind van een string
+ <refpurpose>
+ Verwijdert whitespace van het begin en eind van een string
</refpurpose>
</refnamediv>
<refsect1>
@@ -13,13 +12,86 @@
<methodsynopsis>
<type>string</type><methodname>trim</methodname>
<methodparam><type>string</type><parameter>str</parameter></methodparam>
+ <methodparam
+choice="opt"><type>string</type><parameter>charlist</parameter></methodparam>
</methodsynopsis>
+ <note>
+ <simpara>
+ Het optionele <parameter>charlist</parameter> parameter was
+ toegevoegd in PHP 4.1.0
+ </simpara>
+ </note>
<para>
- Deze functie stript whitespace van het begin en einde van een
- string en geeft de gestripte string terug. De whitespace karakters
- die het stript zijn: "\n", "\r", "\t",
"\v", "\0", en een normale
- space.
+ Deze functie verwijdert whitespace van het begin en einde van een
+ string en geeft de nieuwe string terug.
+ Zonder het tweede parameter zal <function>trim</function> de volgende
+ tekens verwijderen:
+ <!-- sorted by importance. Printed 3 times: trim, ltrim, rtrim -->
+ <itemizedlist>
+ <listitem>
+ <simpara>
+ " " (<acronym>ASCII</acronym> <literal>32</literal>
+ (<literal>0x20</literal>)), een normale spatie.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ "\t" (<acronym>ASCII</acronym> <literal>9</literal>
+ (<literal>0x09</literal>)), een tab.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ "\n" (<acronym>ASCII</acronym> <literal>10</literal>
+ (<literal>0x0A</literal>)), een new line (line feed).
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ "\r" (<acronym>ASCII</acronym> <literal>13</literal>
+ (<literal>0x0D</literal>)), een carriage return.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ "\0" (<acronym>ASCII</acronym> <literal>0</literal>
+ (<literal>0x00</literal>)), een <literal>NUL</literal>-byte.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara> <!-- not \v, since not supported by PHP -->
+ "\x0B" (<acronym>ASCII</acronym> <literal>11</literal>
+ (<literal>0x0B</literal>)), een verticale tab.
+ </simpara>
+ </listitem>
+ </itemizedlist>
</para>
+ <para>
+ Het is ook mogelijk de tekens die moeten worden verwijderd te
+ specificeren met de <parameter>charlist</parameter>.
+ Je kunt simpelweg alle tekens die moeten worden verwijderd opsommen.
+ Met <literal>..</literal> kan je een rij tekens specificeren.
+ </para>
+ <example>
+ <title>Voorbeeld van het gebruik van <function>trim</function></title>
+ <para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+
+$text = "\t\tDit zijn een paar woorden :) ... ";
+$trimmed = trim($text);
+// $trimmed = "Dit zijn een paar woorden :) ..."
+$trimmed = trim($text," \t.");
+// $trimmed = "Dit zijn een paar woorden :)"
+$clean = trim($binary,"\0x00..\0x1F");
+// verwijder de ASCII control characters van het begin en het eind van $binary
+// (van 0 tot en met 31)
+
+?>
+]]>
+ </programlisting>
+ </para>
+ </example>
<para>
Zie ook <function>chop</function>, <function>rtrim</function> en
<function>ltrim</function>.
Index: phpdoc-nl/reference/strings/functions/wordwrap.xml
diff -u phpdoc-nl/reference/strings/functions/wordwrap.xml:1.1
phpdoc-nl/reference/strings/functions/wordwrap.xml:1.2
--- phpdoc-nl/reference/strings/functions/wordwrap.xml:1.1 Sun Apr 14 21:37:43
2002
+++ phpdoc-nl/reference/strings/functions/wordwrap.xml Mon May 20 07:32:22 2002
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- splitted from ./nl/functions/strings.xml, last change in rev 1.1 -->
-<!-- last change to 'wordwrap' in en/ tree in rev 1.142 -->
+<!-- EN-Revision: 1.2 Maintainer: sander Status: ready -->
<refentry id="function.wordwrap">
<refnamediv>
<refname>wordwrap</refname>
@@ -33,15 +32,23 @@
Als <parameter>cut</parameter> 1 is, wordt de string altijd
gewrapt naar de gegeven width. Dus als je een woord hebt dat langer
is dan de gegeven width, wordt die gebroken (zie tweede voorbeeld).
+ <note>
+ <para>
+ Het optionele parameter <parameter>cut</parameter> was toegevoegd in
+ PHP 4.0.3
+ </para>
+ </note>
</para>
<para>
<example>
<title><function>wordwrap</function> voorbeeld</title>
<programlisting role="php">
-$text = "The quick brown fox jumped over the lazy dog.";
+<![CDATA[
+$text = "The quick brown fox jumped over the lazy dog.";
$newtext = wordwrap( $text, 20 );
-echo "$newtext\n";
+echo "$newtext\n";
+]]>
</programlisting>
</example>
</para>
@@ -51,8 +58,10 @@
<para>
<informalexample>
<programlisting>
+<![CDATA[
The quick brown fox
jumped over the lazy dog.
+]]>
</programlisting>
</informalexample>
</para>
@@ -60,10 +69,12 @@
<example>
<title><function>wordwrap</function> example</title>
<programlisting role="php">
-$text = "Een heel lang woooooooooooord.";
-$newtext = wordwrap( $text, 8, "\n", 1);
+<![CDATA[
+$text = "Een heel lang woooooooooooord.";
+$newtext = wordwrap( $text, 8, "\n", 1);
-echo "$newtext\n";
+echo "$newtext\n";
+]]>
</programlisting>
</example>
</para>