Print variable types

From LemonWiki共筆
Revision as of 15:40, 31 December 2017 by Planetoid (talk | contribs)
Jump to navigation Jump to search

Print type of the variable

  • PHP gettype(): echo "type of variable: " . gettype($var);[1]
  • Python type():[2][3] or print(type(var))
type(var) # return <class 'type'>
print(type(var))
print("type of variable: " + str(type(var))) # python v. 3 cast type to string
  • Javascript typeof()[4]
typeof var
console.log("type of variable:: " + typeof var)

references


Troubleshooting of ...

Template