|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-11-13 09:18 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 06 03:00:01 2025 UTC |
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