Special Types

There are 2 special data types in PHP

  1. Resource
  2. Null

Resource Data type:

It refers the external resources like database connection, FTP connection, file pointers, etc. In simple terms, a resource is a special variable which carrying a reference to an external resource.

Example 1

PHP Special Types

Example 2

PHP Special Types

Example 3

PHP Special Types

Null Data Type:

A variable of type Null is a variable without any data. In PHP, null is not a value, and we can consider it as a null variable based on 3 condition.

  1. If the variable is not set with any value.
  2. If the variable is set with a null value.
  3. If the value of the variable is unset.

Example 1

PHP Special Types

Example 2

PHP Special Types

Example 3

PHP Special Types
Next TopicPHP Tutorial




Contact US

Email:[email protected]

Special Types
10/30