public static function compare_purge_tokens($tokena, $tokenb) {
        if ($tokena === $tokenb) {
            // There is an exact match.
            return 0;
        }

        // The token for when the cache was last invalidated.
        list($atime) = explode('-', "{$tokena}-", 2);

        // The token for this cache.
        list($btime) = explode('-', "{$tokenb}-", 2);

        if ($atime >= $btime) {
            // Token A is newer.
            return 1;
        } else {
            // Token A is older.
            return -1;
        }
    }
public static function compare_purge_tokens($tokena, $tokenb) {
        if ($tokena === $tokenb) {
            // There is an exact match.
            return 0;
        }

        // The token for when the cache was last invalidated.
        list($atime) = explode('-', "{$tokena}-", 2);

        // The token for this cache.
        list($btime) = explode('-', "{$tokenb}-", 2);

        if ($atime >= $btime) {
            // Token A is newer.
            return 1;
        } else {
            // Token A is older.
            return -1;
        }
    }
public static function compare_purge_tokens ( $ tokena , $ tokenb ) { if ( $ tokena === $ tokenb ) { // There is an exact match. return 0 ; } // The token for when the cache was last invalidated. list ( $ atime ) = explode ( '-' , "{$tokena}-" , 2 ) ; // The token for this cache. list ( $ btime ) = explode ( '-' , "{$tokenb}-" , 2 ) ; if ( $ atime >= $ btime ) { // Token A is newer. return 1 ; } else { // Token A is older. return - 1 ; } }
Compare a pair of purge tokens.

If the two tokens are identical, then the return value is 0.
If the time component of token A is newer than token B, then a positive value is returned.
If the time component of token B is newer than token A, then a negative value is returned.

Note: This function is intended for use from within the Cache API only and not by plugins, or cache stores.

@param   string  $tokena
@param   string  $tokenb
@return  int
Compare a pair of purge tokens .