|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-08-24 09:03 UTC] andrei@php.net
[2000-08-24 09:10 UTC] jmoore@php.net
[2000-08-24 09:51 UTC] jmoore@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Jun 17 23:00:01 2026 UTC |
The documentation for preg_replace says the function supports four arguments: pattern, replacement, subject, and limit. However, PHP (4.0.1pl2) does not appear to support the last argument, limit. Script: <?php $subject = "The tiger ate plants while a tiger watched."; echo preg_replace("/tiger/", "giraffe", $subject, 1); ?> Expected output: The giraffe ate plants while a tiger watched. Actual output: Warning: Wrong parameter count for preg_replace() in dir/file.php on line 2 phpinfo() shows: PCRE (Perl Compatible Regular Expressions) Support: enabled PCRE Library Version: 3.1 09-Feb-2000. Configure Command: ./configure' '--with-apache=../apache' '--with-mysql=/usr/local/mysql' '--without-gd' '--without-ttf' '--with-ftp' '--with-xml' '--with-config-file-path=/etc' '--disable-debug' '--enable-track-vars=yes' Regards, Simon Garner