PHP Syntax and Variables

¡Supera tus tareas y exámenes ahora con Quizwiz!

Can a variable name start with a number?

no

Is php case sensitive?

no

Name the 8 types of data types?

Integers, doubles, Boolean, Null, strings, arrays, objects and resources

&& concept

Is only concerned if the first part of comparison is true Once the system knows the answer it will evaluate whether to stop or continue the program

What is the default value of a variable?

It is 0

What type of language is PHP?

It's a scripting language

How is PHP code executed?

It's executed on a web server

What are the three different variable scopes?

Local, Global, Static

Who can edit the php.ini type of file?

The system administrators

What is the purpose of phpinfo()?

This tag will show how PHP is configured, version information, and the settings of all environment variables

Define ===

True if arguments are equal and the same data type

Define !==

True if arguments are not equal or they are not of the same data type

Define xor

True if either (but not both) of its arguments are true

How do I define a constant?

Using define ()

How to begin a variable?

With a $ (dollar sign) as well as a letter or underscore

What is a comment?

a line of code that is not read/executed as part of the program

What do PHP statements end with?

a semicolon (;)

Global Scope

a variable is declared outside a function and can only be accessed outside a function

Local Scope

a variable is declared within a function and can only be accessed inside a function

Global Keyword

used to access a global variable from within a function must be used before the variables inside the functions

Static

used when a variable needs to be reused and not deleted

How would you assign the value ' Hello ' to the letter x?

$x = "Hello"

Name the 3 types of logical operators

(&&)....,(||)....,(!)

Name the five arithmetic operators

(+)...,(-)...,(*)...,(/)...,(%)

What is string concatenation?

(.=), takes two strings and places them together

Name 8 assignment operators

(=) ....., (+=)......, (-=).......,( /=)....., (*=) .....,(%=).......,(++)......, (- -)

Name the 5 comparison operators

(==)....,(!=)....,(< >)....,(<=)....,(>=)

What are the two types of PHP tags that PHP code should be placed between?

,> code ?> And <?php code ?>

T or F: <> and != are the same

T

T or F: Variables do not have to be declared nor do data types?

T

T or F: a variable name must start with a letter or the underscore character?

T

7 essential programming concepts

- variables and types, computation and logic, input/output, selection, repetition, data aggregation, code aggregation

How to begin a multiple line comment block

/* and */

Two symbols to begin a single line comment

// and #

Name the three legal commenting styles for php?

// single line comment # perl style single line comment /* multiple line comments */

What is the difference between 2 comparisons vs 3 comparisons

3 comparisons are concerned about data types while 2 comparisons are not concerned about types

What does a PHP script begin with?

<?php

Write hello world program?

<html> <head> <title>Hello World </title> </head> <body> <?php $name = "World"; Echo "<h1> Hello, $name! </h1>"; ?> </body> </html>

What does a PHP script end with?

?>

T or F: PHP is compiled instead of interpreted

F : PHP gets interpreted instead of being compiled

T or F: and/ or are the same as && and || but with higher precedent

F: and/or are the same as (&&) and (||) but with lower precedent

PHP and Data Type conversion

PHP automatically converts the variable to the correct data type, depending on its value

What is the main I configuration for php?

PHP.ini


Conjuntos de estudio relacionados

anatomy: heart 2 homework questions

View Set

BIOL 1040: Masteringbiology: Exam 3

View Set

A+ Chapt 00 - Assessment Examine - Intro

View Set

Chapter 16 - Regulating Competition (Antitrust Laws)

View Set

Ophthalmic Optics Boards Review - Dr. Mckee's Notes

View Set

Ch. 12 CNS Depressants and Muscle Relaxants

View Set

5.07 UNIT TEST: Counting and Probability - Part 1

View Set