php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #12340 ereg's documentation is wrong
Submitted: 2001-07-24 10:37 UTC Modified: 2001-07-24 10:42 UTC
From: baumann at valudo dot de Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: 4.0.6 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: baumann at valudo dot de
New email:
PHP Version: OS:

 

 [2001-07-24 10:37 UTC] baumann at valudo dot de
Hi there,

I'm sad to tell you, that I think to have found an error in your documentation or in PHP (that's up to you guys :)

When I was trying to find a pattern in a string with ereg, I did not get any result in $regs[1] as you wrote. I found it in $regs[0] where the copy of the whole string supposed to be. So I think that's a mistake, isn't it??

But anyway, good work folks,

c ya...

Tom

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-07-24 10:42 UTC] andy@php.net
Try looking at a script like this:

<?
ereg("(.*)\.(.*)","25.67",$regs);
for ($i=0;$i<count($regs);$i++){
echo "$i -- $regs[$i]<br>";
}
?>


regs[0] will have "25.67"
regs[1] will have "25"
regs[2] will have "67"

The documentation is correct.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 02:01:29 2024 UTC