I often find myself doing quick checks like this:
if (!eregi(\'.php\', $fileName)) {
$filename .= \'.php\';
}
But as eregi() was deprec
Try this, I'm using this quite a lot since I updated to PHP 5 recently.
Previously:
if(eregi('-', $_GET['id'])
{
return true;
}
Now I'm using this - it works just as good.
if(preg_match('/(.+)-(.+)/', $_GET['id'])) {
{
return true;
}
Just replace your code with the following, and you shouldn't have any hitch of difference within your code. If you're wondering why PHP remove eregi() it's because of the performance issues it has when used a lot, so it's better to use preg_match() as it's more specific in searching so it has better performance and rendering times.
Let me know how this works for you.