cvs: phpdoc-fr /language types.xml
| From: | Mehdi Achour | Date: | Wed, 26 Nov 2003 08:42:01 +0000 |
| Subject: | cvs: phpdoc-fr /language types.xml | ||
| Groups: | php.doc.fr | ||
| Request: | Send a blank email to doc-fr+get-949@lists.php.net to get a copy of this message | ||
didou Wed Nov 26 03:42:01 2003 EDT
Modified files:
/phpdoc-fr/language types.xml
Log:
clarification: curly braces can be used to modify strings too
Index: phpdoc-fr/language/types.xml
diff -u phpdoc-fr/language/types.xml:1.30 phpdoc-fr/language/types.xml:1.31
--- phpdoc-fr/language/types.xml:1.30 Fri Oct 3 04:08:17 2003
+++ phpdoc-fr/language/types.xml Wed Nov 26 03:42:01 2003
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.30 $ -->
+<!-- $Revision: 1.31 $ -->
<chapter id="language.types">
<title>Les types</title>
<sect1 id="language.types.intro">
@@ -954,7 +954,7 @@
// il générera une note E_NOTICE (undefined constant).
echo "Ceci est faux : {$arr[foo][3]}";
-// Fonctionne. Lorsuqe vous utilisez un tableau multidimensionnel dans
+// Fonctionne. Lorsque vous utilisez un tableau multidimensionnel dans
// une chaîne, n'oubliez jamais les accolades.
echo "Ceci fonctionne : {$arr['foo'][3]}";
@@ -971,9 +971,9 @@
</sect4>
</sect3>
<sect3 id="language.types.string.substr">
- <title>Accès aux caractères d'une
chaîne</title>
+ <title>Accès et modification des caractères d'une
chaîne</title>
<para>
- Les caractères d'une chaîne sont accessibles en
spécifiant
+ Les caractères d'une chaîne sont accessibles et modifiables en
spécifiant
leur offset (le premier caractère est d'offset 0) entre
accolade, après le nom de la variable.
</para>
@@ -1000,6 +1000,11 @@
// Lit le dernier caractère de la chaîne
$str = 'Ceci est un test.';
$last = $str{strlen($str)-1};
+
+// Modifie le dernier caractère de la chaîne
+$str = 'Ceci est un test.';
+$str{strlen($str)-1} = '!';
+
?>
]]>
</programlisting>