Bug #15329 Updated: Subscripting into strings would be useful
| From: | hek at loudoun-net dot com | Date: | Mon, 04 Feb 2002 15:16:19 +0000 |
| Subject: | Bug #15329 Updated: Subscripting into strings would be useful | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-79098@lists.php.net to get a copy of this message | ||
ID: 15329
Updated by: hek@loudoun-net.com
Reported By: hek@loudoun-net.com
Status: Bogus
Bug Type: Feature/Change Request
Operating System: N/A
PHP Version: 4.1.1
New Comment:
Thank you. I know about substr() -- which is rather cumbersome
compared with the notation I suggested -- but I don't know what you
mean by {}.
I cannot find this notation explainined in the PHP Manual (at least not
in the pages about array functions, about the array type, nor in the
pages about operators).
Where is {} usage described?
--HaigEK
Previous Comments:
------------------------------------------------------------------------
[2002-02-01 14:50:01] derick@php.net
Already supported by {} and substr.
Derick
------------------------------------------------------------------------
[2002-02-01 13:48:17] hek@loudoun-net.com
The now very old North Star BASIC had a wonderful feature that I'd love
to see in PHP, which was the ability to access strings using
subscripts, rather like subscripting into an array, except even better
since it allowed ranges to be subscripted just as easily as single
characters in the strings.
Examples:
$string = "My String";
echo $string[5]; // returns "r"
echo $string[0,]; // returns "My String"
echo $string[3,5]; // returns "Str"
echo $string[,3]; // returns "My S"
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=15329&edit=1