Intro to PHP Flashcards
What was PHP created for?
It was creating for tracking visitors in 1994
What did PHP originally stand for?
Personal Home Page
What does PHP stand for now?
PHP Hypertext Preprocessor or Hypertext Preprocessor
Is Javascript a client side or server side language?
It is usually client side
What are the differences between a compiled language and an interpreted language?
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
Platforms that combine compiled and interpreted language are a trend: name a few
BASIC, C, Lisp, Pascal, and Python
Why use PHP?
To build a dynamic webpage
Interactive UI
Be used with web frameworks or template
engines to develop interactive websites.
What does PHP not do?
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 could you hide the fact that php is being used?
Use a .html extension and place php in the document
What do webpages combine which languages?
PHP code
• HTML
• JavaScript
• Some MySQL statements
It is laid out with CSS
What is the most efficient way of using the php tag?
Start and end the document with php tags
Smallest possible fragments of php
Leave the rest of the document in html (faster)
How do you write a comment in php?
// or /* */
What is the difference between single quotes and double quotes?
Single quotes are a literal string
Double quotes will attempt to process it as a variable
How do you escape tabs, new lines or carriage returns?
\t, \n, and \r
How do you append a string?
With a period dot between items