PHP TutorialLesson 8Free preview
PHP Data Types
This lesson is part of PHP · All levels
Summary
PHP provides a variety of built-in data types such as strings, integers, floats, booleans, arrays, and null. This lesson explains the characteristics of each type and how to check it with the functions gettype() and var_dump(). Understanding the data type is important so that the operations and comparisons you write are not wrong.
Key points
- Inbuilt types: string, integer, float, boolean, array, and
- String for text, integer for integer, float for decimal
- The boolean has only two possibilities, namely true or false
- Gettype() displays the type name, var_dump() displays the type and its value
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.