note 102067 added to function.substr-replace
| From: | marcin_kuzawinski at tlen dot pl | Date: | Wed, 26 Jan 2011 00:22:30 +0000 |
| Subject: | note 102067 added to function.substr-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-176311@lists.php.net to get a copy of this message | ||
Funny. Second parameter may be an array. For example
echo substr_replace('xxx', array('a', 'b'), 1, 1);
is valid and it prints 'xax'.
But array to string conversation should be, and normally is 'Array':
echo substr_replace('xxx', (string) array('a', 'b'), 1, 1);
Output:
xArrayx
Maybe it's a bug, maybe it is not. Don't know, don't care. But always good to know.
----
Server IP: 69.147.83.197
Probable Submitter: 62.121.67.117
----
Manual Page -- http://www.php.net/manual/en/function.substr-replace.php
Edit -- https://master.php.net/note/edit/102067
Del: integrated -- https://master.php.net/note/delete/102067/integrated
Del: useless -- https://master.php.net/note/delete/102067/useless
Del: bad code -- https://master.php.net/note/delete/102067/bad+code
Del: spam -- https://master.php.net/note/delete/102067/spam
Del: non-english -- https://master.php.net/note/delete/102067/non-english
Del: in docs -- https://master.php.net/note/delete/102067/in+docs
Del: other reasons-- https://master.php.net/note/delete/102067
Reject -- https://master.php.net/note/reject/102067
Search -- https://master.php.net/manage/user-notes.php