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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
33 - 23 = ?
Subscribe to this entry?

 
 [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-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 10:01:28 2024 UTC