php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39489 eregi doesn't always work
Submitted: 2006-11-13 08:10 UTC Modified: 2006-11-13 09:18 UTC
From: rsarceno at yahoo dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.2.0 OS: Windows 2000
Private report: No CVE-ID: None
 [2006-11-13 08:10 UTC] rsarceno at yahoo dot com
Description:
------------
The function eregi doesn't work if my compare string is ".info", ".name" or ".net"

Reproduce code:
---------------
if (eregi("[.aero]$",$domain_name)) {
    echo "domain is aero";
}elseif (eregi("[.com]$",$domain_name)) {
    echo "domain is com";
}elseif (eregi("[.info]$",$domain_name)) {
    echo "domain is info";
}elseif (eregi("[.name]$",$domain_name)) {
    echo "domain is name";
}elseif (eregi("[.net]$",$domain_name)) {
    echo "domain is net";}


Expected result:
----------------
$domain_name = "domain.aero";
echo domain is aero

$domain_name = "domain.com";
echo domain is com

$domain_name = "domain.info";
echo domain is info

$domain_name = "domain.name";
echo domain is name

$domain_name = "domain.net";
echo domain is name



Actual result:
--------------
$domain_name = "domain.aero";
echo domain is aero

$domain_name = "domain.com";
echo domain is com

$domain_name = "domain.info";
echo 

$domain_name = "domain.name";
echo 

$domain_name = "domain.net";
echo 


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-11-13 09:18 UTC] tony2001@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Dec 06 04:00:01 2025 UTC