Gen. partnerAlgotech

PHP function gettype()

Returns the type of the variable.

|
September 11, 2019

Availability in PHP 4.0

Returns the type of the variable.

Parameters

Parameter Data type Default value Note
$var mixed not Variable to check

Return values

string

Returns the type of the variable.

Returns one of the following:

  • boolean
  • integer
  • double (for historical reasons, double is returned instead of float, based on the C implementation of PHP, which uses double)
  • string
  • array
  • object
  • resource
  • NULL
  • unknown type (unknown type)

Other resources

Official gettype documentation

Loading comments...

Stay in the loop

Subscribe to our newsletter and get the latest cybersecurity news delivered straight to your inbox.

Your data is safe. You can unsubscribe from the newsletter at any time.