php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11064 ereg() doe's not accept the third argument as reported in doc
Submitted: 2001-05-23 16:54 UTC Modified: 2001-05-24 15:45 UTC
From: jmt at freeshell dot org Assigned:
Status: Not a bug Package: Regexps related
PHP Version: 4.0.5 OS: linux 2.2
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: jmt at freeshell dot org
New email:
PHP Version: OS:

 

 [2001-05-23 16:54 UTC] jmt at freeshell dot org
try this :
ereg( $a, $b, $c );

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-05-23 19:56 UTC] sniper@php.net
And what should happen? You try this:

<?php

$date = date("Y-m-d");

if (ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})", $date, $regs)) {
    echo "$regs[3].$regs[2].$regs[1]";
} else {
    echo "Invalid date format: $date";
}   

?>

Works for me just fine.


 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue Nov 24 04:01:23 2020 UTC