“函数eregi()已弃用”试过preg_match - 没有bueno [重复]

This question already has an answer here:

I've read many threads here about this being deprecated and tried replacing it with preg_match but I don't know php enough to fix the rest of the line.

Been enjoying Fotoholder for years, I would switch to a newer similar single file gallery code but then I would lose all my descriptions in the gallery.

Please help resurrect Fotopholder! ( https://github.com/offsky/Fotopholder )

Here are the 2 parts that have eregi:

    
                if(substr($entry,0,1)!="." && !preg_match("#_cache#i",$entry) && is_dir($path."/".$entry)) {
                    

and the 2nd eregi:

                        if(substr($entry,0,1)!="." && !eregi("_cache",$entry)) {

Thank you very much for your help.

</div>

Deprecated means, that the function eregi() is likely to get deleted from the language.

Please use preg_match().

While you still can use eregi(), at a certain point of time your application might not be able to execute any more.

That said: Your code posted is far to big to get a detailed answer.