Type Casting

Explicitly converts data types

 

(target data type)identifier

 

Displays:

42

52

 

Displays:

$myInt, 123, is of data type: integer
$myFloat, 12.34, is of data type: double

 

 

To test a certain datatype:

  • is_string()
  • is_float()
  • is_int()
  • is_bool()
  • is_array()
  • is_object()
  • is_resource()
  • is_null()

Leave a Reply