Data Types

2 Fundamentals Data Yypes:

  • Numerical
    • Integer
    • Floating Point
    • Octal start with 0
    • Hex start with 0x
  • String
    • Single quote
      • Literal text
    • Double quote
      • Interploated
      • Any variables are expanded

PHP automatically evaluates data as it is assigned depending upon the context in which it is used, and therefore does not need to be specifically declared as a particular data type.

 

However, type casting can also be applied to set the target to a specific data type.

int 

double

string

array

bool

null

object

 

Integer 

Floating point number

String

Array

Boolean

NULL

Object. Instance of a class

Resource

Whole Number. No decimal point 

Real numbers

Series of characters, usually defined within "double quotes"

Named indexed collection of key with their values

Logical TRUE or FALSE

No Value. Nothing whatsoever! Not empty. Not Zero. Nothing! NULL

Object. Instance of a class

References to external resources (functions, databases, files)

Leave a Reply