MongoId::isValid

(PECL mongo >= 1.5.0)
Check 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().

Parameters:
value

The value to check for validity.

Returns:

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

doc_php
2016-02-24 16:20:48
Comments
Leave a Comment

Please login to continue.