I am converting an old PHP4-5 script to make it PHP 7 compatible.
I have the following line:
if ( eregi('^'.$_POST["category"],$r->id) ) $Category_List .= (' selected ');
Can I simply do this?
if ( preg_match('^'.$_POST["category"],$r->id) ) $Category_List .= (' selected ');
or do I need to do this?
if ( preg_match('"/^('.$_POST["category"],$r->id).')/"i' ) $Category_List .= (' selected ');