protected function readAndVerify($handle, $file)
    {
        // Read all content
        $content = fread($handle, filesize($file));
        $content = @unserialize($content);

        // Check if content is valid
        if ($content && is_array($content) && time() < $content[0]) {
            return $content;
        } else {
            return false;
        }
    }
protected function readAndVerify($handle, $file)
    {
        // Read all content
        $content = fread($handle, filesize($file));
        $content = @unserialize($content);

        // Check if content is valid
        if ($content && is_array($content) && time() < $content[0]) {
            return $content;
        } else {
            return false;
        }
    }
protected function readAndVerify ( $ handle , $ file ) { // Read all content $ content = fread ( $ handle , filesize ( $ file ) ) ; $ content = @ unserialize ( $ content ) ; // Check if content is valid if ( $ content && is_array ( $ content ) && time ( ) < $ content [ 0 ] ) { return $ content ; } else { return false ; } }
Read file by handle and verify if content is expired

@param  resource    $handle file handle
@param  string      $file   file path
@return false|array false or file content array
Read file by handle and verify if content is expired