hi

i have a problem with eregi function in a script i have

i was wondering if anyone can suggest a replacement for the code listed below, to replace the eregi function with something else

Function eregi() is deprecated in C:\xampp\htdocs\site\include\misc.inc.php on line 358

heres the offending code from line 358:

// If the last number is a zero, it's divisible by 10 check it...
if (eregi("0$", $count)) {
break;
}

any help with this issue whould be usefull, thank you

    While the successor of the ereg/eregi function is [man]preg_match/man, there's no need to use it if all you want to know is the divisibility of a number - that's where the modulus operator comes in handy. Example:

    $num = 1360;
    
    if($num % 10 == 0)
        echo "$num is divisible by 10!";
      Write a Reply...