Intro to PHP Flashcards

1
Q

What was PHP created for?

A

It was creating for tracking visitors in 1994

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What did PHP originally stand for?

A

Personal Home Page

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does PHP stand for now?

A

PHP Hypertext Preprocessor or Hypertext Preprocessor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Is Javascript a client side or server side language?

A

It is usually client side

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the differences between a compiled language and an interpreted language?

A

An interpreted language requires an interpreter

Execute instructions directly, without compiling into
machine code
– Requires a interpreter executes the program directly
• translating each statement into a sequence of one or
more subroutines
– Already compiled into machine code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Platforms that combine compiled and interpreted language are a trend: name a few

A

BASIC, C, Lisp, Pascal, and Python

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Why use PHP?

A

To build a dynamic webpage

Interactive UI

Be used with web frameworks or template
engines to develop interactive websites.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does PHP not do?

A

Like all other Server-side languages, PHP provides the
“business logic” behind what you are seeing

• Cannot handle client-side UI tasks:
– mouse-overs
– pop-up windows
– etc.

• Alternatively, PHP can send JavaScript to the web
browser
– send text via HTML to the web browser.
– Client-side languages generate final web page

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How could you hide the fact that php is being used?

A

Use a .html extension and place php in the document

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What do webpages combine which languages?

A

PHP code
• HTML
• JavaScript
• Some MySQL statements

It is laid out with CSS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the most efficient way of using the php tag?

A

Start and end the document with php tags

Smallest possible fragments of php

Leave the rest of the document in html (faster)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How do you write a comment in php?

A

// or /* */

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the difference between single quotes and double quotes?

A

Single quotes are a literal string

Double quotes will attempt to process it as a variable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How do you escape tabs, new lines or carriage returns?

A

\t, \n, and \r

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How do you append a string?

A

With a period dot between items

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What do three

A

It signals a heredoc