Warning: eregi() [function.eregi]: REG_EMPTY

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ankuj.gupta
Forum Newbie
Posts: 2
Joined: Sun Jul 13, 2008 4:55 am

Warning: eregi() [function.eregi]: REG_EMPTY

Post by ankuj.gupta »

I have been getting this error

Warning: eregi() [function.eregi]: REG_EMPTY in D:\xampp\htdocs\bilingual_dictionary\search.php on line 123

The code that is producing this error is

Code: Select all

 
function patternmatch($ill,$redirects,$pagelink)
 
{
        $i=0;
        while($pagelink[$i])
        {
    /*line 123*/        if(eregi($ill[$i],$pagelink[$i]))  
            {
                    $lts[]= $pagelink[$i];
            } 
            $i=$i+1;
        }
        return $lts;
}
What does this error mean
Thanks
Ankuj
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: Warning: eregi() [function.eregi]: REG_EMPTY

Post by jaoudestudios »

It seems like you are passing an empty variable to the eregi function.

Check your $ill[$i], that it does not have an empty element.
ankuj.gupta
Forum Newbie
Posts: 2
Joined: Sun Jul 13, 2008 4:55 am

Re: Warning: eregi() [function.eregi]: REG_EMPTY

Post by ankuj.gupta »

I have retrieved the value of $ill[$i] and a value does exist there.But still it give the error
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: Warning: eregi() [function.eregi]: REG_EMPTY

Post by jaoudestudios »

The value that exists there is it a regular expression? because that is what it is expecting.

Manual...
http://uk3.php.net/manual/en/function.ereg.php
Post Reply