1. 程式人生 > >解決Call to undefined function ftok()

解決Call to undefined function ftok()

自定義一個函式,即可解決

function myftok($pathname, $proj_id)
{
    $st = @stat($pathname);
    if (!$st) {
        return -1;
    }
    $key = sprintf("%u", (($st['ino'] & 0xffff) | (($st['dev'] & 0xff) << 16) | (($proj_id & 0xff) << 24)));
    return $key;
}