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
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: 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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 15:01:29 2024 UTC