lecture2.variables - Media Software Design DIG 3134 -...

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

View Full Document Right Arrow Icon
1 DIG 3134 - Lecture 2: Rapid Introduction To PHP Programming OR Review: Variables and Functions Michael Moshell University of Central Florida Media Software Design
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 The Objectives: Acquire/refresh key programming ideas Learn how to debug a small program
Background image of page 2
3 The Strategy: Start slow, make sure you got it 9:00
Background image of page 3

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

View Full DocumentRight Arrow Icon
4 The Strategy: Start slow, make sure you got it Accelerate rapidly Lose 25% of you 9:15 9:00
Background image of page 4
5 The Strategy: Start slow, make sure you got it Accelerate rapidly Lose 25% of you See (some of) you in office 9:15 9:45 9:00
Background image of page 5

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

View Full DocumentRight Arrow Icon
6 The Strategy: Start slow, make sure you got it Accelerate rapidly Lose 25% of you See (some of) you in office Drop/ add Wed 9:15 9:45 9:00
Background image of page 6
7 Concept (-1): "Hello World" The first program you write in a new language: <?php print "Hello world!"; ?>
Background image of page 7

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

View Full DocumentRight Arrow Icon
8 Concept 0: PHP in HTML PHP is an embedded language. It can exist INSIDE an HTML document. <html> <body> <?php $x=43; ?> <h2> Welcome to the <?php print $x; ?> rd Reunion!</h2> </body> </html>
Background image of page 8
9 But Remember . . Javascript is also an embedded language, BUT Javascript is executed by the CLIENT (Browser) PHP is executed by the SERVER (Internet host) This has MANY consequences, as we will see. -: Less immediate interaction than Javascript +: More control, reliability, centralized development *: Ajax combines BOTH (client and server-side)
Background image of page 9

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

View Full DocumentRight Arrow Icon
10 Concept 1: Data types Numbers: - Integers 0, 2, 4, 8 - Floating point 2.45, -888.99 [no real distinction in PHP]
Background image of page 10
11 Concept 1: Data types Numbers: - Integers 0, 2, 4, 8 - Floating point 2.45, -888.99 [no real distinction in PHP] Strings (of characters) -’Joe Wilson’ -”My left foot” -”3, 47, 238, 222.44”
Background image of page 11

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

View Full DocumentRight Arrow Icon
12 Concept 1: Data types Numbers: - Integers 0, 2, 4, 8 - Floating point 2.45, -888.99 [no real distinction in PHP] Strings (of characters) -’Joe Wilson’ -”My left foot” -”3, 47, 238, 222.44” Boolean: true, false
Background image of page 12
13 Concept 1: Data types PHP plays ‘fast and loose’ with types. You can mix and match them, and it Does the best it can to figure out your Meaning. Examples coming soon.
Background image of page 13

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

View Full DocumentRight Arrow Icon
14 Concept 2: Variables (simple) Think of a variable as a labelled box. $x Name of the Variable (always begins With $) Contents: Can be number, String or Boolean. The CONTENTS of all the variables in a program Represent its STATE or MEMORY.
Background image of page 14
15 Concept 3: Assignments,Constants Putting something into a variable: $x Before the assignment: After the assignment: $x = 47; $x 47 The computer executes this statement, or command.
Background image of page 15

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

View Full DocumentRight Arrow Icon
Concept 3: Assignments,Constants Putting something into a variable: $x Before the assignment: After the assignment: $x = 47; $x 47 The computer executes this statement, or command. That’s a constant (something that doesn’t change.)
Background image of page 16
Image of page 17
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 08/25/2011 for the course DIG 3134 taught by Professor Moshell during the Fall '11 term at University of Central Florida.

Page1 / 58

lecture2.variables - Media Software Design DIG 3134 -...

This preview shows document pages 1 - 17. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online