Jump to content

[SOLVED] how to compare the first digit of a number?


zgkhoo

Recommended Posts

Use strstr, eg:

if($row['PurchaseNo'] == substr($_POST['firstprize'], 0, 1))
{
    //PurchaseNo matches first number in $_POST['firstprize']
}
else
{
     //PurchaseNo doesn't match first number in $_POST['firstprize']
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.