w3resource

php.js : get_resource_type() function

get_resource_type() function

The get_resource_type() function is used to get the resource type name for a given resource.

Version:

1103.1210

Syntax:

get_resource_type(handle)

Parameters:

Name Description Required /
Optional
Type
handle Resource type of a given resource. Required Resource

Example of php.js get_resource_type() function

In the following web document get_resource_type() function returns the resource type for a given resource.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>php.js : get_resource_type() function example</title> <script type="text/javascript" src="../../phpjs/variable/variable.min.js"> </script> </head> <body> <h1 style="color: green">php.js : get_resource_type() function example</h1> <h3>Resource type name for a given resource.</h3> <hr /> <script type="text/javascript"> //This is done to make the following JavaScript code compatible to XHTML. <![CDATA[ x='abc'; y=new Array(12,13,14,15); document.write(get_resource_type(x)+'<br />'); document.write(get_resource_type(y)); //]]> </script> </body> </html>

Output of the function:

false
false 

View example of php.js get_resource_type() function in browser

Download phpjs.zip

Previous: php.js : get_defined_vars() function
Next: php.js : gettype() function



Share this Tutorial / Exercise on : Facebook and Twitter