{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

PHP Introduction.pptx - PHP Hypertext Preprocessor = An...

Info iconThis preview shows pages 1–11. Sign up to view the full content.

View Full Document Right Arrow Icon
PHP: Hypertext Preprocessor = An introduction to variables and data types Week 8
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
PHP PHP Delimiter s
Background image of page 2
Variables Storage Location Can store a string or number Strings (‘’ ‘’) Number (no quotation marks) Case-sensitive and must start with a $ $marysAge = 35; (declaring a variable and assigning a value)
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Data Types in PHP String Integer Float (floating point numbers - also called double) Boolean Array Object NULL Resource
Background image of page 4
String data type A string is a sequence of characters , like "Hello world!". A string can be any text inside quotes . You can use single or double quotes: Example <?php $x = "Hello world!"; $y = 'Hello world again!'; echo $x; echo "<br>"; echo $y; ?>
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Integer data type An integer data type is a non-decimal number Rules for integers: ▫An integer must have at least one digit An integer must not have a decimal point An integer can be either positive or negative In the following example $x is an integer. The PHP var_dump() function returns the data type and value:
Background image of page 6
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 8
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 10
Background image of page 11
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}