php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #60230 Parameters to explain the role of error
Submitted: 2011-11-07 06:53 UTC Modified: 2011-11-07 07:32 UTC
From: yanghbmail at 126 dot com Assigned: laruence (profile)
Status: Closed Package: Documentation problem
PHP Version: 5.3.8 OS: windows xp
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: yanghbmail at 126 dot com
New email:
PHP Version: OS:

 

 [2011-11-07 06:53 UTC] 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;


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-11-07 07:31 UTC] laruence@php.net
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 07:32 UTC] laruence@php.net
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:32 UTC] laruence@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: laruence
 [2024-01-16 21:24 UTC] wed4fg_fdffg1 at gmail dot com
very helpful...!

https://vintagewatches.pk?Casio-Watches-Pakistan-github.com
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Tue Oct 06 09:00:02 2026 UTC