From 79349659b289c9ac54d77a353efcef5e2776f263 Mon Sep 17 00:00:00 2001 From: Philip Olson Date: Tue, 2 May 2006 18:05:54 +0000 Subject: [PATCH] Expand $str[42] syntax info a little more, $str{42} deprecated as of PHP 6, and adjust example accordingly git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@212308 c90b9560-bf6c-de11-be94-00142212c4b1 --- language/types.xml | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/language/types.xml b/language/types.xml index d28a11caa2..30f59d499e 100644 --- a/language/types.xml +++ b/language/types.xml @@ -1,5 +1,5 @@ - + Types @@ -1084,13 +1084,14 @@ echo "I'd like to have another {${ strrev('reeb') }}, hips"; Characters within strings may be accessed and modified by specifying the zero-based offset of the desired character after the string - in curly braces. + using square array-brackets like $str[42] so think of + a string as an array of characters. - For backwards compatibility, you can still use array-brackets - for the same purpose. However, this syntax is deprecated as - of PHP 4. + For backwards compatibility, you may still use braces like + $str{42} for the same purpose. However, this syntax + is deprecated as of PHP 6. @@ -1101,19 +1102,22 @@ echo "I'd like to have another {${ strrev('reeb') }}, hips"; ]]>