Fri, 17 May 2024


How to check in PHP if a variable is a database result?

By: Nathalie, NetArt Media
Sat, 5 February 2022

The special PHP function is_resource helps to do this.
So to check if a variable is a database result you may do the following:

<?php

if(is_resource($myVar))
{

...

}

?>


Category: PHP Examples
Share this post:



See All Scripts






Subscribe for our newsletter

Receive the latest blog posts direct in your mailbox