Doc #60230 [Com]: Parameters to explain the role of error

[email protected] ("wed4fg_fdffg1 at gmail dot com") Tue, 16 Jan 2024 21:24:34 +0000
Newsgroups php.doc.bugs
Message-ID <[email protected]>
Edit report at https://bugs.php.net/bug.php?id=60230&edit=1

 ID:                 60230
 Comment by:         wed4fg_fdffg1 at gmail dot com
 Reported by:        yanghbmail at 126 dot com
 Summary:            Parameters to explain the role of error
 Status:             Closed
 Type:               Documentation Problem
 Package:            Documentation problem
 Operating System:   windows xp
 PHP Version:        5.3.8
 Assigned To:        laruence
 Block user comment: N
 Private report:     N

 New Comment:

very helpful...!

https://vintagewatches.pk?Casio-Watches-Pakistan-github.com


Previous Comments:
------------------------------------------------------------------------
[2011-11-07 07:32:06] [email protected]

This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.



------------------------------------------------------------------------
[2011-11-07 07:31:47] [email protected]

Automatic comment from SVN on behalf of laruence
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=318874
Log: Fixed doc bug #60230 Parameters to explain the role of error

------------------------------------------------------------------------
[2011-11-07 06:53:39] yanghbmail at 126 dot com

Description:
------------
---
From manual page: http://www.php.net/function.str-replace#refsect1-function.str-replace-parameters
---
str_replace
count 
If passed, this will be set to the number of replacements performed. 
May be wrong
The role is to count.
this return a count, Not match the number of control.
Thanks!
--------------------------------
str_replace中的第四个参数count的作用的解释似乎是错误的。
它的作用是返回匹配的次数,而不是设置匹配的次数。
谢谢!

Test script:
---------------
$str = 'THIS IS PHP,PHP IS VERY GOOD!I LIKE PHP VERYMUCH';
$search = 'PHP';
$replace = '<a href="http://www.php.net">PHP</a>';
$count=1;
echo str_replace($search, $replace, $str,$count) ;
echo ' >'.$count;



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=60230&edit=1