note 46118 added to function.substr
| From: | patrick dot ogren at twc dot state dot tx dot us | Date: | Wed, 29 Sep 2004 23:05:27 +0000 |
| Subject: | note 46118 added to function.substr | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-77591@lists.php.net to get a copy of this message | ||
Is there any reason that this won't work?
$test = "abcdefghijklmnop";
$var[0] = substr($test,4,8);
$var[1] = substr_replace($test,********,4,8);
print_r($var);
Using PHP 4.3.1, the results of $var are [0] = a, [1] = e
Weird.
The way around it is:
$var = array(0 => (substr($test,4,8)), 1=> (substr_replace($test,********,4,8)));
Which gives proper results.
Is this a current bug, or am I missing something obvious?
----
Manual Page -- http://www.php.net/manual/en/function.substr.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+46118
Delete -- http://master.php.net/manage/user-notes.php?action=delete+46118&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+46118&report=yes
Search -- http://master.php.net/manage/user-notes.php