Mdst3705 2013-01-24-php2
-
Upload
rafael-alvarado -
Category
Documents
-
view
576 -
download
0
description
Transcript of Mdst3705 2013-01-24-php2
![Page 1: Mdst3705 2013-01-24-php2](https://reader033.fdocuments.in/reader033/viewer/2022061121/546e67c4af7959ed048b5e80/html5/thumbnails/1.jpg)
PHP 2
Prof AlvaradoMDST 3705
24 January 2013
![Page 2: Mdst3705 2013-01-24-php2](https://reader033.fdocuments.in/reader033/viewer/2022061121/546e67c4af7959ed048b5e80/html5/thumbnails/2.jpg)
Business• Reference materials posted• Use the principle of “TMI filtering”
– Filter out what has not been covered– Be comfortable with knowing a little
![Page 3: Mdst3705 2013-01-24-php2](https://reader033.fdocuments.in/reader033/viewer/2022061121/546e67c4af7959ed048b5e80/html5/thumbnails/3.jpg)
Review• Programming languages were invented so
that people could more easily control computers– Human like to interact with objects in the
world through language• But like natural languages, programming
languages involve worlds– Worlds are implied by code – Worlds are modeled in code– Worlds are created by code
![Page 4: Mdst3705 2013-01-24-php2](https://reader033.fdocuments.in/reader033/viewer/2022061121/546e67c4af7959ed048b5e80/html5/thumbnails/4.jpg)
![Page 5: Mdst3705 2013-01-24-php2](https://reader033.fdocuments.in/reader033/viewer/2022061121/546e67c4af7959ed048b5e80/html5/thumbnails/5.jpg)
We live in “Barricell’s Universe”
A world that has emerged from the use of a a specific kind of
computer
![Page 6: Mdst3705 2013-01-24-php2](https://reader033.fdocuments.in/reader033/viewer/2022061121/546e67c4af7959ed048b5e80/html5/thumbnails/6.jpg)
PHP as a language• Variables
– Variables are like nouns– Refer to locations in memory (pigeon holes)
• Values– Values are like meanings– Strings and numbers that are stored in
memory• Expressions
– Expressions, e.g. $x + 1, are like clauses– Expressions always “return” a value
![Page 7: Mdst3705 2013-01-24-php2](https://reader033.fdocuments.in/reader033/viewer/2022061121/546e67c4af7959ed048b5e80/html5/thumbnails/7.jpg)
Sentences• Code is written in sentences called
“instructions” Imperative and inquisitive modes– Imperative
• $x = $y; // Like saying, “Let $x = $y”• $x = 1 * 50 + $z;
– Inquisitive• If ($x == 1) {} // Like asking, “Is $x equal to 1?”
![Page 8: Mdst3705 2013-01-24-php2](https://reader033.fdocuments.in/reader033/viewer/2022061121/546e67c4af7959ed048b5e80/html5/thumbnails/8.jpg)
Sigils• $ as a prefix to variables
– Common in languages – Perl, Java, JavaScript
– Useful mnemonic device – avoids “Hungarian notation”
• Derives from medieval and renaissance magic– Sigil as a seal representing an angel or
demon – a “logo”• Also used as a personal logo
![Page 9: Mdst3705 2013-01-24-php2](https://reader033.fdocuments.in/reader033/viewer/2022061121/546e67c4af7959ed048b5e80/html5/thumbnails/9.jpg)
Todays Exercises• Emulate the 10 PRINT program in PHP• Learn about arrays, control structures,
and functions • Riff on the model to produce other
outcomes
![Page 10: Mdst3705 2013-01-24-php2](https://reader033.fdocuments.in/reader033/viewer/2022061121/546e67c4af7959ed048b5e80/html5/thumbnails/10.jpg)
Resources• PHP
– Manual from PHP’s Home Page– PHP for Absolute Beginners
• HTML and CSS– W3Schools