|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-07-23 21:23 UTC] philip@php.net
[2003-07-24 08:07 UTC] sniper@php.net
[2003-07-24 20:06 UTC] pollita@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 14 17:00:01 2025 UTC |
Description: ------------ str_[i]replace() has a count parameter that returns a variable (by reference) with a count of replacements. This is not counting when the search string is one character in length. Reproduce code: --------------- <?php $count = 0; $str = str_replace('a', '', 'apples are good', $count); echo $count; ?> Expected result: ---------------- 2