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

From: Date: Mon, 07 Nov 2011 06:53:39 +0000
Subject: Doc #60230 [NEW]: Parameters to explain the role of error
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-7393@lists.php.net to get a copy of this message
From:             
Operating system: windows xp
PHP version:      5.3.8
Package:          Documentation problem
Bug Type:         Documentation Problem
Bug description:Parameters to explain the role of error

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 bug report at https://bugs.php.net/bug.php?id=60230&edit=1
-- 
Try a snapshot (PHP 5.4):            https://bugs.php.net/fix.php?id=60230&r=trysnapshot54
Try a snapshot (PHP 5.3):            https://bugs.php.net/fix.php?id=60230&r=trysnapshot53
Try a snapshot (trunk):              https://bugs.php.net/fix.php?id=60230&r=trysnapshottrunk
Fixed in SVN:                        https://bugs.php.net/fix.php?id=60230&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60230&r=needdocs
Fixed in release:                    https://bugs.php.net/fix.php?id=60230&r=alreadyfixed
Need backtrace:                      https://bugs.php.net/fix.php?id=60230&r=needtrace
Need Reproduce Script:               https://bugs.php.net/fix.php?id=60230&r=needscript
Try newer version:                   https://bugs.php.net/fix.php?id=60230&r=oldversion
Not developer issue:                 https://bugs.php.net/fix.php?id=60230&r=support
Expected behavior:                   https://bugs.php.net/fix.php?id=60230&r=notwrong
Not enough info:                     https://bugs.php.net/fix.php?id=60230&r=notenoughinfo
Submitted twice:                     https://bugs.php.net/fix.php?id=60230&r=submittedtwice
register_globals:                    https://bugs.php.net/fix.php?id=60230&r=globals
PHP 4 support discontinued:          https://bugs.php.net/fix.php?id=60230&r=php4
Daylight Savings:                    https://bugs.php.net/fix.php?id=60230&r=dst
IIS Stability:                       https://bugs.php.net/fix.php?id=60230&r=isapi
Install GNU Sed:                     https://bugs.php.net/fix.php?id=60230&r=gnused
Floating point limitations:          https://bugs.php.net/fix.php?id=60230&r=float
No Zend Extensions:                  https://bugs.php.net/fix.php?id=60230&r=nozend
MySQL Configuration Error:           https://bugs.php.net/fix.php?id=60230&r=mysqlcfg



Thread (3 messages)

« previous php.doc.bugs (#7393) next »