LECTURE 3 DATA TYPES AND TYPECASTING

0.0(0)
Studied by 5 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/31

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 4:23 PM on 6/14/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

32 Terms

1
New cards

data type

A ____ is the specific category of information that a variable contains

2
New cards

primitive types

Data types that can be assigned only a single value are called ______

3
New cards

Integer numbers

The set of all positive and negative numbers and zero, with no decimal places

4
New cards

Floating-point

Positive or negative numbers with decimal places of numbers written using exponential notation

5
New cards

Boolean

A logical value of “true” or “false”

6
New cards

String

Text such as “Hello World”

7
New cards

NULL

An empty value, also referred to as a ___ value

8
New cards
  • Integer

  • Float

  • Numeric Strings

Three main numeric types in PHP:

9
New cards

Infinity, NAN

____ - (outside the allowed range)
____ - ( stands for "Not A Number".)

10
New cards

var_dump()

To verify the data type of any variable/object in PHP, use the _____ function

11
New cards

is_int()

The ____ function checks if the type of a variable is integer

12
New cards

float

Another important thing to know is that even if 4 * 2.5 is 10, the result is stored as ____, because one of the operands is a float (2.5).

13
New cards

is_float()

The ____ function checks if the type of a variable is float

14
New cards

is_numeric()

The _____ function is used to check whether a variable is a number or a numeric string

15
New cards

intval()

The ____ function is used to get the integer value of a variable

16
New cards

number_format

Rounds and formats a number with a fixed number of decimal places. Adds commas or separators between thousands for better readability.

17
New cards

number_format

Commonly used in financial applications to display prices, totals, and currency amounts

18
New cards

round()

The ____ function rounds a floating-point number

19
New cards

string

A ____ is a sequence of characters, like "Hello world!"

20
New cards

double quoted

A ____ string will substitute the value of variables, and accepts many special characters, like \n, \r, \t by escaping them

21
New cards

single quoted

A _____ string outputs the string as it is

22
New cards

Boolean

The simplest variable type in PHP, a _____ variable simply specifies a true or false value

23
New cards

1, 0

TRUE = ___
FALSE = ____

24
New cards

Null

___ is a special value that indicates no value

25
New cards

FALSE, zero

NULL converts to boolean ___ and integer ___

26
New cards

isset()

Tests if a variable exists

27
New cards

is_null()

Determines if the given variable is set to NULL. Returns true if variable is NULL, FALSE otherwise

28
New cards

empty()

Determines if a variable is empty

29
New cards

var_dump()

To get the data type and the value of a variable, use the ____ function

30
New cards

data type, value

PHP var_dump() function returns the ____ and ____ of a given variable

31
New cards

type casting

PHP _____ is an explicit process of converting a value from one data type to another, such as from a float to an integer

32
New cards

array

An ____ is a special variable that can store multiple values in a single variable