how do i check if a variable is of a type mysqli object?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
You'll probably want the instanceof operator.
It will work for derived classes as well, in the odd case that you extending or building your own wrappers.
Take a look at get_class
Try the
instanceof
operator, theis_a
function or theget_class
function:Тhe decision of Gumbo works, but in this case must check if
$var
is instance ofmysqli_result
, i.e.http://www.php.net/get_class