cvs: phpdoc-fr /reference/strings/functions html-entity-decode.xml htmlentities.xml htmlspecialchars.xml md5.xml money-format.xml number-format.xml
parse-str.xml rtrim.xml str-ireplace.xml strip-tags.xml strnatcmp.xml strpos.xml strrpos.xml

From: Date: Sat, 22 May 2004 15:18:35 +0000
Subject: cvs: phpdoc-fr /reference/strings/functions html-entity-decode.xml htmlentities.xml htmlspecialchars.xml md5.xml money-format.xml number-format.xml
parse-str.xml rtrim.xml str-ireplace.xml strip-tags.xml strnatcmp.xml strpos.xml strrpos.xml
Groups: php.doc.fr 
Request: Send a blank email to doc-fr+get-2703@lists.php.net to get a copy of this message
didou Sat May 22 11:18:35 2004 EDT Modified files: /phpdoc-fr/reference/strings/functions html-entity-decode.xml htmlentities.xml htmlspecialchars.xml md5.xml money-format.xml number-format.xml parse-str.xml rtrim.xml str-ireplace.xml strip-tags.xml strnatcmp.xml strpos.xml strrpos.xml Log: sync with en

http://cvs.php.net/diff.php/phpdoc-fr/reference/strings/functions/html-entity-decode.xml?r1=1.5&r2=1.6&ty=u Index: phpdoc-fr/reference/strings/functions/html-entity-decode.xml diff -u phpdoc-fr/reference/strings/functions/html-entity-decode.xml:1.5 phpdoc-fr/reference/strings/functions/html-entity-decode.xml:1.6 --- phpdoc-fr/reference/strings/functions/html-entity-decode.xml:1.5 Wed Feb 25 07:40:56 2004 +++ phpdoc-fr/reference/strings/functions/html-entity-decode.xml Sat May 22 11:18:35 2004 @@ -1,7 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> -<!-- splitted from ./en/functions/strings.xml, last change in rev 1.2 --> +<!-- $Revision: 1.6 $ --> +<!-- EN-Revision: 1.9 Maintainer: didou Status: ready --> <refentry id="function.html-entity-decode"> <refnamediv> <refname>html_entity_decode</refname> @@ -65,23 +64,23 @@ <programlisting role="php"> <![CDATA[ <?php - $orig = "J'ai \"sorti\" le <b>chien</b> tout à l'heure"; - $a = htmlentities($orig); - $b = html_entity_decode($a); +$orig = "J'ai \"sorti\" le <b>chien</b> tout à l'heure"; +$a = htmlentities($orig); +$b = html_entity_decode($a); - echo $a; // J'ai &quot;sorti&quot; le &lt;b&gt;chien&lt;/b&gt; tout &amp;agrave; l'heure - echo $b; // J'ai "sorti" le <b>chien</b> tout à l'heure +echo $a; // J'ai &quot;sorti&quot; le &lt;b&gt;chien&lt;/b&gt; tout &amp;agrave; l'heure +echo $b; // J'ai "sorti" le <b>chien</b> tout à l'heure // Pour les utilisateurs ayant des versions antérieures à PHP 4.3.0 : - function unhtmlentities ($string) { - $trans_tbl = get_html_translation_table (HTML_ENTITIES); - $trans_tbl = array_flip ($trans_tbl); - return strtr ($string, $trans_tbl); - } +function unhtmlentities ($string) +{ + $trans_tbl = get_html_translation_table (HTML_ENTITIES); + $trans_tbl = array_flip ($trans_tbl); + return strtr ($string, $trans_tbl); +} - $c = unhtmlentities($a); - echo $c; -// J'ai "sorti" le <b>chien</b> tout à l'heure +$c = unhtmlentities($a); +echo $c; // J'ai "sorti" le <b>chien</b> tout à l'heure ?> ]]> </programlisting> @@ -99,13 +98,12 @@ </note> </para> <para> - Voir aussi - <function>htmlentities</function>, - <function>htmlspecialchars</function>, - <function>get_html_translation_table</function>, - <function>htmlspecialchars</function> et - <function>urldecode</function>. - </para> + Voir aussi + <function>htmlentities</function>, + <function>get_html_translation_table</function>, + <function>htmlspecialchars</function> et + <function>urldecode</function>. + </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/strings/functions/htmlentities.xml?r1=1.9&r2=1.10&ty=u Index: phpdoc-fr/reference/strings/functions/htmlentities.xml diff -u phpdoc-fr/reference/strings/functions/htmlentities.xml:1.9 phpdoc-fr/reference/strings/functions/htmlentities.xml:1.10 --- phpdoc-fr/reference/strings/functions/htmlentities.xml:1.9 Wed Feb 25 07:40:56 2004 +++ phpdoc-fr/reference/strings/functions/htmlentities.xml Sat May 22 11:18:35 2004 @@ -1,7 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.9 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> -<!-- splitted from ./en/functions/strings.xml, last change in rev 1.2 --> +<!-- $Revision: 1.10 $ --> +<!-- EN-Revision: 1.10 Maintainer: didou Status: ready --> <refentry id="function.htmlentities"> <refnamediv> <refname>htmlentities</refname> @@ -21,10 +20,14 @@ <methodname>htmlentities</methodname> est identique à la fonction <function>htmlspecialchars</function>, sauf que tous les caractères qui ont des équivalents en entités HTML sont effectivement - traduits. Comme <function>htmlspecialchars</function>, cette + traduits. + </para> + <para> + Comme <function>htmlspecialchars</function>, cette fonction prend un deuxième argument optionnel, qui indique comment doivent être traités les guillemets doubles et simples. - Vous pouvez utiliser l'une des constantes suivantes : + Vous pouvez utiliser l'une des constantes suivantes la valeur par + défaut étant <constant>ENT_COMPAT</constant> : <table> <title>Constantes disponibles pour <parameter>quote_style</parameter></title> <tgroup cols="2"> @@ -86,13 +89,13 @@ </example> </para> <para> - Voir aussi - <function>html_entity_decode</function>, - <function>get_html_translation_table</function>, - <function>htmlspecialchars</function>, - <function>nl2br</function> et - <function>urlencode</function>. - </para> + Voir aussi + <function>html_entity_decode</function>, + <function>get_html_translation_table</function>, + <function>htmlspecialchars</function>, + <function>nl2br</function> et + <function>urlencode</function>. + </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/strings/functions/htmlspecialchars.xml?r1=1.9&r2=1.10&ty=u Index: phpdoc-fr/reference/strings/functions/htmlspecialchars.xml diff -u phpdoc-fr/reference/strings/functions/htmlspecialchars.xml:1.9 phpdoc-fr/reference/strings/functions/htmlspecialchars.xml:1.10 --- phpdoc-fr/reference/strings/functions/htmlspecialchars.xml:1.9 Wed Feb 25 07:40:56 2004 +++ phpdoc-fr/reference/strings/functions/htmlspecialchars.xml Sat May 22 11:18:35 2004 @@ -1,7 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.9 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> -<!-- splitted from ./en/functions/strings.xml, last change in rev 1.2 --> +<!-- $Revision: 1.10 $ --> +<!-- EN-Revision: 1.7 Maintainer: didou Status: ready --> <refentry id="function.htmlspecialchars"> <refnamediv> <refname>htmlspecialchars</refname> @@ -92,17 +91,18 @@ </para> <para> cette fonction prend un troisième argument optionnel - qui définit le jeux de caractères - utilisé durant la conversion. Le support de cet argument a été - ajouté en &php; 4.1.0. + qui définit le jeux de caractères utilisé durant la conversion. + Le jeu de caractères par défaut est ISO-8859-1. Le support de cet + argument a été ajouté en &php; 4.1.0. </para> &reference.strings.charsets; <para> - Voir aussi - <function>get_html_translation_table</function>, - <function>htmlentities</function> et - <function>nl2br</function>. - </para> + Voir aussi + <function>get_html_translation_table</function>, + <function>strip_tags</function>, + <function>htmlentities</function> et + <function>nl2br</function>. + </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/strings/functions/md5.xml?r1=1.7&r2=1.8&ty=u Index: phpdoc-fr/reference/strings/functions/md5.xml diff -u phpdoc-fr/reference/strings/functions/md5.xml:1.7 phpdoc-fr/reference/strings/functions/md5.xml:1.8 --- phpdoc-fr/reference/strings/functions/md5.xml:1.7 Wed Feb 25 07:40:56 2004 +++ phpdoc-fr/reference/strings/functions/md5.xml Sat May 22 11:18:35 2004 @@ -1,7 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.7 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> -<!-- splitted from ./en/functions/strings.xml, last change in rev 1.135 --> +<!-- $Revision: 1.8 $ --> +<!-- EN-Revision: 1.7 Maintainer: didou Status: ready --> <refentry id="function.md5"> <refnamediv> <refname>md5</refname> @@ -17,7 +16,7 @@ <para> <methodname>md5</methodname> calcule le MD5 de la chaîne de caractères <parameter>str</parameter> en utilisant - l'algorithme <ulink url="&url.rfc;rfc1321.html">RSA Data Security, Inc. + l'algorithme <ulink url="&url.rfc;1321">RSA Data Security, Inc. MD5 Message-Digest Algorithm</ulink>, et retourne le résultat. Le résultat est un nombre de 32 caractères hexadécimaux. </para> @@ -45,11 +44,11 @@ </example> </para> <para> - Voir aussi - <function>crc32</function>, - <function>md5_file</function> et - <function>sha1</function>. - </para> + Voir aussi + <function>crc32</function>, + <function>md5_file</function> et + <function>sha1</function>. + </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/strings/functions/money-format.xml?r1=1.7&r2=1.8&ty=u Index: phpdoc-fr/reference/strings/functions/money-format.xml diff -u phpdoc-fr/reference/strings/functions/money-format.xml:1.7 phpdoc-fr/reference/strings/functions/money-format.xml:1.8 --- phpdoc-fr/reference/strings/functions/money-format.xml:1.7 Wed Feb 25 07:40:56 2004 +++ phpdoc-fr/reference/strings/functions/money-format.xml Sat May 22 11:18:35 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.7 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> +<!-- $Revision: 1.8 $ --> +<!-- EN-Revision: 1.7 Maintainer: didou Status: ready --> <refentry id="function.money-format"> <refnamediv> <refname>money_format</refname> @@ -16,7 +16,7 @@ <para> <function>money_format</function> retourne le nombre <parameter>number</parameter> avec le format financier. Cette fonction fait l'interface avec - la fonction strmon() de la librairie C, à la différence près que + la fonction strfmon() de la librairie C, à la différence près que cette implémentation ne convertit qu'un nombre à la fois. </para> <para> @@ -91,7 +91,7 @@ </para> </formalpara> <formalpara> - <title>Taille de champs</title> + <title>Taille de champ</title> <para> <variablelist> <varlistentry> @@ -219,44 +219,44 @@ <![CDATA[ <?php - $number = 1234.56; +$number = 1234.56; - // Affichons ce nombre au format international pour en_US - setlocale(LC_MONETARY, 'en_US'); - echo money_format('%i', $number)."\n"; - // USD 1,234.56 +// Affichons ce nombre au format international pour en_US +setlocale(LC_MONETARY, 'en_US'); +echo money_format('%i', $number)."\n"; +// USD 1,234.56 - // Et au format italien national avec 2 decimales - setlocale(LC_MONETARY, 'it_IT'); - echo money_format('%.2n', $number)."\n"; - // L. 1.234,56 +// Et au format italien national avec 2 decimales +setlocale(LC_MONETARY, 'it_IT'); +echo money_format('%.2n', $number)."\n"; +// L. 1.234,56 - // Utilisation d'un nombre négatif - $number = -1234.5672; +// Utilisation d'un nombre négatif +$number = -1234.5672; - // Format US national, avec les parenthèeses pour les nombres négatifs - // et 10 chiffres de précision à gauche - setlocale(LC_MONETARY, 'en_US'); - echo money_format('%(#10n', $number)."\n"; - // ($ 1,234.57) +// Format US national, avec les parenthèeses pour les nombres négatifs +// et 10 chiffres de précision à gauche +setlocale(LC_MONETARY, 'en_US'); +echo money_format('%(#10n', $number)."\n"; +// ($ 1,234.57) - // Format similaire au précédent, en ajoutant 2 décimales - // pour la précision à droite, et en utilisant le caractère de remplissage '*' - echo money_format('%=*(#10.2n', $number)."\n"; - // ($********1,234.57) - - // Utilisons maintenant la justification à gauche, avec un champ de 14 caractères - // de longs, sans groupage de chiffres, et en utilisant le format international - // pour de_DE - setlocale(LC_MONETARY, 'de_DE'); - echo money_format('%=*^-14#8.2i', 1234.56)."\n"; - // DEM 1234,56**** +// Format similaire au précédent, en ajoutant 2 décimales +// pour la précision à droite, et en utilisant le caractère de remplissage '*' +echo money_format('%=*(#10.2n', $number)."\n"; +// ($********1,234.57) - // Ajoutons encore à l'exemple précédent - setlocale(LC_MONETARY, 'en_GB'); - $fmt = 'La valeur finale est %i (après 10% de remise)'; - echo money_format($fmt, 1234.56)."\n"; - // La valeur finale est GBP 1,234.56 (après 10% de remise) +// Utilisons maintenant la justification à gauche, avec un champ de 14 caractères +// de longs, sans groupage de chiffres, et en utilisant le format international +// pour de_DE +setlocale(LC_MONETARY, 'de_DE'); +echo money_format('%=*^-14#8.2i', 1234.56)."\n"; +// DEM 1234,56**** + +// Ajoutons encore à l'exemple précédent +setlocale(LC_MONETARY, 'en_GB'); +$fmt = 'La valeur finale est %i (après 10% de remise)'; +echo money_format($fmt, 1234.56)."\n"; +// La valeur finale est GBP 1,234.56 (après 10% de remise) ?> ]]> http://cvs.php.net/diff.php/phpdoc-fr/reference/strings/functions/number-format.xml?r1=1.8&r2=1.9&ty=u Index: phpdoc-fr/reference/strings/functions/number-format.xml diff -u phpdoc-fr/reference/strings/functions/number-format.xml:1.8 phpdoc-fr/reference/strings/functions/number-format.xml:1.9 --- phpdoc-fr/reference/strings/functions/number-format.xml:1.8 Tue Feb 24 13:13:57 2004 +++ phpdoc-fr/reference/strings/functions/number-format.xml Sat May 22 11:18:35 2004 @@ -1,9 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.8 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> - -<!-- splitted from ./fr/functions/math.xml, last change in rev 1.11 --> -<!-- last change to 'number-format' in en/ tree in rev 1.2 --> +<!-- $Revision: 1.9 $ --> +<!-- EN-Revision: 1.5 Maintainer: didou Status: ready --> <refentry id="function.number-format"> <refnamediv> <refname>number_format</refname> @@ -22,11 +19,11 @@ <methodparam><type>int</type><parameter>decimals</parameter></methodparam> <methodparam><type>string</type><parameter>dec_point</parameter></methodparam> <methodparam><type>string</type><parameter>thousands_sep</parameter></methodparam> - </methodsynopsis> <para> - <function>number_format</function> retourne une chaîne - représentant <parameter>number</parameter> formaté. - <function>number_format</function> accepte un, deux ou 4 paramètres - (mais pas trois). + </methodsynopsis> + <para> + <function>number_format</function> retourne une chaîne représentant + <parameter>number</parameter> formaté. <function>number_format</function> + accepte un, deux ou 4 paramètres (mais pas trois). </para> <para> Si seul le paramètre <parameter>number</parameter> est donné, @@ -63,24 +60,30 @@ <programlisting role="php"> <![CDATA[ <?php - $nombre = 1234.56; + +$nombre = 1234.56; // Notation anglaise (par défaut) - $english_format_number = number_format($nombre); -// 1,234.56 +$english_format_number = number_format($nombre); // 1,234.56 + // Notation française - $nombre_format_francais = number_format($nombre, 2, ',', ' '); +$nombre_format_francais = number_format($nombre, 2, ',', ' '); // 1 234,56 + +// Notation anglaise sans séparateurs des centaines +$english_format_number = number_format($number, 2, '.', ''); +// 1234.57 + ?> ]]> </programlisting> </example> </para> - <para> - Voir aussi - <function>sprintf</function>, - <function>printf</function> et - <function>sscanf</function>. - </para> + <para> + Voir aussi + <function>sprintf</function>, + <function>printf</function> et + <function>sscanf</function>. + </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/strings/functions/parse-str.xml?r1=1.9&r2=1.10&ty=u Index: phpdoc-fr/reference/strings/functions/parse-str.xml diff -u phpdoc-fr/reference/strings/functions/parse-str.xml:1.9 phpdoc-fr/reference/strings/functions/parse-str.xml:1.10 --- phpdoc-fr/reference/strings/functions/parse-str.xml:1.9 Wed Feb 25 07:40:56 2004 +++ phpdoc-fr/reference/strings/functions/parse-str.xml Sat May 22 11:18:35 2004 @@ -1,7 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.9 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> -<!-- splitted from ./en/functions/strings.xml, last change in rev 1.2 --> +<!-- $Revision: 1.10 $ --> +<!-- EN-Revision: 1.2 Maintainer: didou Status: ready --> <refentry id="function.parse-str"> <refnamediv> <refname>parse_str</refname> @@ -17,11 +16,10 @@ <para> <function>parse_str</function> analyse la chaîne de caractères <parameter>str</parameter> comme s'il s'agissait d'une requête - HTTP, passée via l'URL, en méthode GET ou POST. Toutes les - variables qu'elle y repère sont alors créées, avec leurs valeurs - respectives. Si le second paramètre <parameter>arr</parameter> - est fourni, les variables y seront stockées, sous forme d'index - de tableau. + HTTP, passée via l'URL. Toutes les variables qu'elle y repère + sont alors créées, avec leurs valeurs respectives. Si le second + paramètre <parameter>arr</parameter> est fourni, les variables + y seront stockées, sous forme d'index de tableau. </para> <note> <para> @@ -60,12 +58,12 @@ </example> </para> <para> - Voir aussi - <function>parse_url</function>, - <function>pathinfo</function>, - <function>set_magic_quotes_runtime</function> et - <function>urldecode</function>. - </para> + Voir aussi + <function>parse_url</function>, + <function>pathinfo</function>, + <function>set_magic_quotes_runtime</function> et + <function>urldecode</function>. + </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/strings/functions/rtrim.xml?r1=1.8&r2=1.9&ty=u Index: phpdoc-fr/reference/strings/functions/rtrim.xml diff -u phpdoc-fr/reference/strings/functions/rtrim.xml:1.8 phpdoc-fr/reference/strings/functions/rtrim.xml:1.9 --- phpdoc-fr/reference/strings/functions/rtrim.xml:1.8 Wed Feb 25 07:40:56 2004 +++ phpdoc-fr/reference/strings/functions/rtrim.xml Sat May 22 11:18:35 2004 @@ -1,7 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.8 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> -<!-- splitted from ./en/functions/strings.xml, last change in rev 1.31 --> +<!-- $Revision: 1.9 $ --> +<!-- EN-Revision: 1.3 Maintainer: didou Status: ready --> <refentry id="function.rtrim"> <refnamediv> <refname>rtrim</refname> @@ -94,10 +93,10 @@ </simpara> </note> <para> - Voir aussi - <function>trim</function> et - <function>ltrim</function>. - </para> + Voir aussi + <function>trim</function> et + <function>ltrim</function>. + </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/strings/functions/str-ireplace.xml?r1=1.5&r2=1.6&ty=u Index: phpdoc-fr/reference/strings/functions/str-ireplace.xml diff -u phpdoc-fr/reference/strings/functions/str-ireplace.xml:1.5 phpdoc-fr/reference/strings/functions/str-ireplace.xml:1.6 --- phpdoc-fr/reference/strings/functions/str-ireplace.xml:1.5 Wed Feb 25 07:40:56 2004 +++ phpdoc-fr/reference/strings/functions/str-ireplace.xml Sat May 22 11:18:35 2004 @@ -1,7 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> -<!-- splitted from ./en/functions/strings.xml, last change in rev 1.2 --> +<!-- $Revision: 1.6 $ --> +<!-- EN-Revision: 1.6 Maintainer: didou Status: ready --> <refentry id="function.str-ireplace"> <refnamediv> <refname>str_ireplace</refname> @@ -50,7 +49,7 @@ <programlisting role="php"> <![CDATA[ <?php - $bodytag = str_ireplace("%body%", "black", "<body text=%BODY%>"); +$bodytag = str_ireplace("%body%", "black", "<body text=%BODY%>"); ?> ]]> </programlisting> @@ -68,12 +67,12 @@ </simpara> </note> <para> - Voir aussi - <function>str_replace</function>, - <function>ereg_replace</function>, - <function>preg_replace</function> et - <function>strtr</function>. - </para> + Voir aussi + <function>str_replace</function>, + <function>ereg_replace</function>, + <function>preg_replace</function> et + <function>strtr</function>. + </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/strings/functions/strip-tags.xml?r1=1.6&r2=1.7&ty=u Index: phpdoc-fr/reference/strings/functions/strip-tags.xml diff -u phpdoc-fr/reference/strings/functions/strip-tags.xml:1.6 phpdoc-fr/reference/strings/functions/strip-tags.xml:1.7 --- phpdoc-fr/reference/strings/functions/strip-tags.xml:1.6 Wed Feb 25 07:40:56 2004 +++ phpdoc-fr/reference/strings/functions/strip-tags.xml Sat May 22 11:18:35 2004 @@ -1,7 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> -<!-- splitted from ./en/functions/strings.xml, last change in rev 1.2 --> +<!-- $Revision: 1.7 $ --> +<!-- EN-Revision: 1.8 Maintainer: didou Status: ready --> <refentry id="function.strip-tags"> <refnamediv> <refname>strip_tags</refname> @@ -26,7 +25,8 @@ <note> <para> <parameter>allowable_tags</parameter> a été ajouté - en &php; 3.0.13 et &php; 4.0b3. + en &php; 3.0.13 et &php; 4.0b3. Depuis &php; 4.3.0, les + commentaires HTML sont aussi supprimés. </para> </note> </para> @@ -36,10 +36,34 @@ <programlisting role="php"> <![CDATA[ <?php - $string = strip_tags($string, '<a><b><i><u>'); +$text = ' +<p>Test paragraph.</p> +<!-- Comment --> +Other text'; + +echo strip_tags($text); + +echo "\n\n-------\n"; + +// permet <p> +echo strip_tags($text, '<p>'); ?> ]]> - </programlisting> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +Test paragraph. + +Other text + +------- + +<p>Test paragraph.</p> + +Other text +]]> + </screen> </example> </para> <warning> @@ -50,6 +74,9 @@ utilisateurs mal intentionnés peuvent utiliser. </para> </warning> + <para> + Voir aussi <function>htmlspecialchars</function>. + </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/strings/functions/strnatcmp.xml?r1=1.7&r2=1.8&ty=u Index: phpdoc-fr/reference/strings/functions/strnatcmp.xml diff -u phpdoc-fr/reference/strings/functions/strnatcmp.xml:1.7 phpdoc-fr/reference/strings/functions/strnatcmp.xml:1.8 --- phpdoc-fr/reference/strings/functions/strnatcmp.xml:1.7 Wed Feb 25 07:40:56 2004 +++ phpdoc-fr/reference/strings/functions/strnatcmp.xml Sat May 22 11:18:35 2004 @@ -1,7 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.7 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> -<!-- splitted from ./en/functions/strings.xml, last change in rev 1.38 --> +<!-- $Revision: 1.8 $ --> +<!-- EN-Revision: 1.5 Maintainer: didou Status: ready --> <refentry id="function.strnatcmp"> <refnamediv> <refname>strnatcmp</refname> @@ -28,19 +27,17 @@ <programlisting role="php"> <![CDATA[ <?php - $arr1 = $arr2 = array("img12.png","img10.png","img2.png","img1.png"); - echo "Tri de chaînes standard\n"; - usort($arr1,"strcmp"); - print_r($arr1); - echo "\nTri de chaînes \"ordre naturel\"\n"; - usort($arr2,"strnatcmp"); - print_r($arr2); +$arr1 = $arr2 = array("img12.png", "img10.png", "img2.png", "img1.png"); +echo "Tri de chaînes standard\n"; +usort($arr1, "strcmp"); +print_r($arr1); +echo "\nTri de chaînes \"ordre naturel\"\n"; +usort($arr2, "strnatcmp"); +print_r($arr2); ?> ]]> </programlisting> - <para> - Le code ci-dessus générera ce qui suit : - </para> + &example.outputs; <screen> <![CDATA[ Tri de chaînes standard http://cvs.php.net/diff.php/phpdoc-fr/reference/strings/functions/strpos.xml?r1=1.9&r2=1.10&ty=u Index: phpdoc-fr/reference/strings/functions/strpos.xml diff -u phpdoc-fr/reference/strings/functions/strpos.xml:1.9 phpdoc-fr/reference/strings/functions/strpos.xml:1.10 --- phpdoc-fr/reference/strings/functions/strpos.xml:1.9 Wed Feb 25 07:40:56 2004 +++ phpdoc-fr/reference/strings/functions/strpos.xml Sat May 22 11:18:35 2004 @@ -1,7 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.9 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> -<!-- splitted from ./en/functions/strings.xml, last change in rev 1.8 --> +<!-- $Revision: 1.10 $ --> +<!-- EN-Revision: 1.5 Maintainer: didou Status: ready --> <refentry id="function.strpos"> <refnamediv> <refname>strpos</refname> @@ -35,18 +34,22 @@ <programlisting role="php"> <![CDATA[ <?php - $mystring = 'abc'; - $findme = 'a'; - $pos = strpos($mystring, $findme); +$mystring = 'abc'; +$findme = 'a'; +$pos = strpos($mystring, $findme); // Notez l'utilisation de ===. Un simple == ne donnerait pas le résultat escompté // car la lettre 'a' est à la position 0 (la première). - if ($pos === false) { +if ($pos === false) { echo "La chaîne '$findme' n'a pas été trouvée dans la chaîne '$mystring'"; - } else { +} else { echo "La chaîne '$findme' a été trouvée dans la chaîne '$mystring'"; echo " et à la position $pos"; - } +} + +// On peut chercher le caractère, en ignorant tout avant une position +$newstring = 'abcdef abcdef'; +$pos = strpos($newstring, 'a', 1); // $pos = 7, pas 0 ?> ]]> </programlisting> @@ -64,15 +67,15 @@ relative au début de la chaîne <parameter>haystack</parameter>. </para> <para> - Voir aussi - <function>strrpos</function>, - <function>stripos</function>, - <function>strripos</function>, - <function>strrchr</function>, - <function>substr</function>, - <function>stristr</function> et - <function>strstr</function>. - </para> + Voir aussi + <function>strrpos</function>, + <function>stripos</function>, + <function>strripos</function>, + <function>strrchr</function>, + <function>substr</function>, + <function>stristr</function> et + <function>strstr</function>. + </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-fr/reference/strings/functions/strrpos.xml?r1=1.11&r2=1.12&ty=u Index: phpdoc-fr/reference/strings/functions/strrpos.xml diff -u phpdoc-fr/reference/strings/functions/strrpos.xml:1.11 phpdoc-fr/reference/strings/functions/strrpos.xml:1.12 --- phpdoc-fr/reference/strings/functions/strrpos.xml:1.11 Fri May 14 11:14:43 2004 +++ phpdoc-fr/reference/strings/functions/strrpos.xml Sat May 22 11:18:35 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.11 $ --> -<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> +<!-- $Revision: 1.12 $ --> +<!-- EN-Revision: 1.9 Maintainer: didou Status: ready --> <refentry id="function.strrpos"> <refnamediv> <refname>strrpos</refname> @@ -20,7 +20,7 @@ <function>strrpos</function> retourne la position numérique de la dernière occurence du caractère <parameter>needle</parameter> dans la chaîne <parameter>haystack</parameter>. Notez que - <parameter>needle</parameter> doit être un caractère unique. + <parameter>needle</parameter> doit être un caractère unique en &php; 4. Si une chaîne est passée dans ce paramètre, seul le premier caractère sera utilisé. </para> @@ -44,7 +44,7 @@ // en versions plus anciennes que 4.0b3 : $pos = strrpos($machaine, "b"); -if (!is_bool($pos) && !$pos) +if (is_bool($pos) && !$pos) // pas trouvé } ?>
« previous php.doc.fr (#2703) next »