检查是否从PHP时间戳开始经过了5分钟

I've done some research but nothing useful come out.

I need to check if a DB time stamp is -5 minutes from current time stamp. That time stamp is created with PHP time() function.

I tried with this without any luck:

$timestamp = "1451999400";

if(strtotime($timestamp) > strtotime("-5 minutes")) {
    echo "A";
} else {
    echo "B";
}

That code always returns "B".

First make sure, that both the database and the PHP are using the same time zone. Then:

$timestamp = "1451999400";

if($timestamp > time() - 60*5) {
    echo "A";
} else {
    echo "B";
}

You don't need to convert the string to integer, because PHP will auto-convert it to a numeric type (possibly integer). (Because of the > operator)