update : 2015.11.03
php.shukuma.com

검색:
 
 
Check if a value is a valid ObjectId

MongoId::isValid

(PECL mongo >= 1.5.0)

MongoId::isValidCheck if a value is a valid ObjectId

설명

public static bool MongoId::isValid ( mixed $value )

This method may be used to check a variable before passing it as an argument to MongoId::__construct().

인수

value

The value to check for validity.

반환값

Returns TRUE if value is a MongoId instance or a string consisting of exactly 24 hexadecimal characters; otherwise, FALSE is returned.