SlideShare a Scribd company logo
INTRO TO SERVER-SIDE PROGRAMMING
Friday, September 6, 13
PHP As A Language
PHP can be treated as a distinct language with it’s own rules
It has it’s own vocabulary - words that are familiar to the language
PHP has distinct grammatical rules
Syntax - rules to determine the composition of sentences
Semantics - the meaning and significance of words
Structure - the relationship between words
Friday, September 6, 13
Grammar and Vocaublary
Reserved Words and Keywords: if, else, ifelse; for, foreach,
while, do; and, or, xor; public, private, protected
Expressions: semicolon (;), curly braces ({...})
Arithmetic: addition (+), subtraction (-), multiplication(*)
Comparisons: equality (==), inequalities (!=), ranges (<=)
Special cases: dollar($), braces ([...]), operators (&, |, <<)
User & Built-in Constants: PHP_VERSION, E_ERROR,
E_WARNING, E_NOTICE, MY_CONSTANT
User & Built-in Functions: shuffle(), printf(), strlen()
Friday, September 6, 13
The PHP Manual - http://php.net/manual/en/
In your “assignments” workspace, create a file called “assignment-2.1.md” to
work on your answers to the following questions:
Find at least three different methods to get a random value from an array
with a built-in function (Look in Array Functions)
What does the built-in md5() function do? What is the default return
value? What built-in functions work similarly?
What is another name for “anonymous functions” in PHP and where are
they in the manual? When were they added and what was the last feature
added?
What is the default value of the “memory_limit” setting in PHP? What
value would I set to it in order to allocate ALL memory to PHP? How could I
set that value and where would I find that in the manual?
Friday, September 6, 13
Data Types - Literals
Literals are also known as Primitive Values
Representative of fixed values, such as numbers, text, etc
Four scalar types: boolean, integer float (double) & string
Two compound types: array & object
Three special types: resource, NULL & callable
What makes 1 different from 1.0?
Friday, September 6, 13
Working With Variables
Variables are storage locations with identifiers that contain values
Variables are places to store your literals. Think of a bucket.
$a_variable // This is a bucket to hold literals!
$a_variable = “some value” // Now the bucket has stuff in it
$a_variable = “something else” // The bucket remains, but a
new string is put in it
Variables in PHP are always preceded with a dollar sign ($)
Variables are not very useful empty, so they are usually followed
with an assignment operator
Friday, September 6, 13
Assignment Operators
An operator accepts one or more literals or variables, performs
an operation on them and returns the results, like a calculator.
$total = 1 // total is defined as 1
$total = $total + 1 // total is now 2
$total += 2 // total is now 4 (old total plus 2)
Orders of operation and precedence still apply here!
Friday, September 6, 13
Basic “Phrases”
Variables, basic expressions and comments:
$david = ‘awesome’; // not entirely true
Basic assignment and arithmetic operators:
$counter = 1; $counter = 2;
$counter = 1 + 1;
$counter += 2;
Getting feedback from PHP:
echo $counter;
var_dump($counter); var_export($counter);
Friday, September 6, 13
ASSIGNMENT TWO
Friday, September 6, 13
Pulling Files From Git
Open your “assignments” workspace in Cloud9
In the console, type “git remote -v” to see the repository URL for
the remote named “origin”
Connect the “assignments” repository from the class to yours:
Go to https://github.com/vcc-dig1108/assignments
Copy the repo URL to your clipboard
In the Cloud9 console, type “git remote add upstream “ (with the space at
the end) and paste the URL that you copied
Now “git remote -v” should list “origin” and “upstream”
Friday, September 6, 13
Pulling Files From Git (cont)
To get the updated code from remote use “git fetch” (try with -h)
Use “git merge” to roll that update into your local branch
You should now have the updated file “homework-2.1.md”
All instructions are in the assignment:
Open the project that you forked earlier or fork one now
Grab around 50 lines of PHP from that project that show examples of
literals, variables, function calls and other colored (important) things
If there is something that you don’t recognize, note it for later
The goal is to practice “reading” PHP grammar for now
Friday, September 6, 13

More Related Content

What's hot

Intermediate PHP
Intermediate PHPIntermediate PHP
Intermediate PHP
Bradley Holt
 
Dev traning 2016 basics of PHP
Dev traning 2016   basics of PHPDev traning 2016   basics of PHP
Dev traning 2016 basics of PHP
Sacheen Dhanjie
 
Data types in php
Data types in phpData types in php
Data types in php
ilakkiya
 
Operators in PHP
Operators in PHPOperators in PHP
Operators in PHP
Vineet Kumar Saini
 
PHP Powerpoint -- Teach PHP with this
PHP Powerpoint -- Teach PHP with thisPHP Powerpoint -- Teach PHP with this
PHP Powerpoint -- Teach PHP with this
Ian Macali
 
Introduction to php php++
Introduction to php php++Introduction to php php++
Introduction to php php++
Tanay Kishore Mishra
 
Php Tutorials for Beginners
Php Tutorials for BeginnersPhp Tutorials for Beginners
Php Tutorials for Beginners
Vineet Kumar Saini
 
Learn PHP Basics
Learn PHP Basics Learn PHP Basics
Learn PHP Basics
McSoftsis
 
Php
PhpPhp
PHP variables
PHP  variablesPHP  variables
PHP variables
Siddique Ibrahim
 
Operators php
Operators phpOperators php
Operators php
Chandni Pm
 
My cool new Slideshow!
My cool new Slideshow!My cool new Slideshow!
My cool new Slideshow!
omprakash_bagrao_prdxn
 
slidesharenew1
slidesharenew1slidesharenew1
slidesharenew1
truptitasol
 
Subroutines in perl
Subroutines in perlSubroutines in perl
Subroutines in perl
sana mateen
 
Php.ppt
Php.pptPhp.ppt
Php.ppt
Nidhi mishra
 
Class 2 - Introduction to PHP
Class 2 - Introduction to PHPClass 2 - Introduction to PHP
Class 2 - Introduction to PHP
Ahmed Swilam
 
Php using variables-operators
Php using variables-operatorsPhp using variables-operators
Php using variables-operators
Khem Puthea
 
PHP
PHPPHP
testing add
testing addtesting add
testing add
alind tiwari
 
03phpbldgblock
03phpbldgblock03phpbldgblock
03phpbldgblock
IIUM
 

What's hot (20)

Intermediate PHP
Intermediate PHPIntermediate PHP
Intermediate PHP
 
Dev traning 2016 basics of PHP
Dev traning 2016   basics of PHPDev traning 2016   basics of PHP
Dev traning 2016 basics of PHP
 
Data types in php
Data types in phpData types in php
Data types in php
 
Operators in PHP
Operators in PHPOperators in PHP
Operators in PHP
 
PHP Powerpoint -- Teach PHP with this
PHP Powerpoint -- Teach PHP with thisPHP Powerpoint -- Teach PHP with this
PHP Powerpoint -- Teach PHP with this
 
Introduction to php php++
Introduction to php php++Introduction to php php++
Introduction to php php++
 
Php Tutorials for Beginners
Php Tutorials for BeginnersPhp Tutorials for Beginners
Php Tutorials for Beginners
 
Learn PHP Basics
Learn PHP Basics Learn PHP Basics
Learn PHP Basics
 
Php
PhpPhp
Php
 
PHP variables
PHP  variablesPHP  variables
PHP variables
 
Operators php
Operators phpOperators php
Operators php
 
My cool new Slideshow!
My cool new Slideshow!My cool new Slideshow!
My cool new Slideshow!
 
slidesharenew1
slidesharenew1slidesharenew1
slidesharenew1
 
Subroutines in perl
Subroutines in perlSubroutines in perl
Subroutines in perl
 
Php.ppt
Php.pptPhp.ppt
Php.ppt
 
Class 2 - Introduction to PHP
Class 2 - Introduction to PHPClass 2 - Introduction to PHP
Class 2 - Introduction to PHP
 
Php using variables-operators
Php using variables-operatorsPhp using variables-operators
Php using variables-operators
 
PHP
PHPPHP
PHP
 
testing add
testing addtesting add
testing add
 
03phpbldgblock
03phpbldgblock03phpbldgblock
03phpbldgblock
 

Viewers also liked

New Beginnings Program Shell
New Beginnings Program ShellNew Beginnings Program Shell
New Beginnings Program Shell
jeanette_ep
 
Cara merawat rangka
Cara merawat rangkaCara merawat rangka
Cara merawat rangka
okejelly
 
Innovative performance support
Innovative performance supportInnovative performance support
Innovative performance support
Jacopo Nicelli
 
Presentation14
Presentation14Presentation14
Presentation14
Tahir Tahiri
 
Practica de hadward
Practica de hadwardPractica de hadward
Practica de hadward
Mark Anthony Malue
 
Managed Data Services
Managed Data ServicesManaged Data Services
Managed Data Services
gregc65x
 
RevoOFIndustry
RevoOFIndustryRevoOFIndustry
RevoOFIndustry
thumore88
 

Viewers also liked (7)

New Beginnings Program Shell
New Beginnings Program ShellNew Beginnings Program Shell
New Beginnings Program Shell
 
Cara merawat rangka
Cara merawat rangkaCara merawat rangka
Cara merawat rangka
 
Innovative performance support
Innovative performance supportInnovative performance support
Innovative performance support
 
Presentation14
Presentation14Presentation14
Presentation14
 
Practica de hadward
Practica de hadwardPractica de hadward
Practica de hadward
 
Managed Data Services
Managed Data ServicesManaged Data Services
Managed Data Services
 
RevoOFIndustry
RevoOFIndustryRevoOFIndustry
RevoOFIndustry
 

Similar to Dig1108C Lesson 2

Training on php by cyber security infotech (csi)
Training on  php by cyber security infotech (csi)Training on  php by cyber security infotech (csi)
Training on php by cyber security infotech (csi)
Cyber Security Infotech Pvt. Ltd.
 
Php mysql
Php mysqlPhp mysql
Php mysql
Alebachew Zewdu
 
Php
PhpPhp
Advanced Perl Techniques
Advanced Perl TechniquesAdvanced Perl Techniques
Advanced Perl Techniques
Dave Cross
 
What's new, what's hot in PHP 5.3
What's new, what's hot in PHP 5.3What's new, what's hot in PHP 5.3
What's new, what's hot in PHP 5.3
Jeremy Coates
 
WT_PHP_PART1.pdf
WT_PHP_PART1.pdfWT_PHP_PART1.pdf
WT_PHP_PART1.pdf
HambardeAtharva
 
Introduction to php basics
Introduction to php   basicsIntroduction to php   basics
PHP Workshop Notes
PHP Workshop NotesPHP Workshop Notes
PHP Workshop Notes
Pamela Fox
 
Was können wir von Rebol lernen?
Was können wir von Rebol lernen?Was können wir von Rebol lernen?
Was können wir von Rebol lernen?
lichtkind
 
Introduction to Modern Perl
Introduction to Modern PerlIntroduction to Modern Perl
Introduction to Modern Perl
Dave Cross
 
Intro to PHP
Intro to PHPIntro to PHP
Intro to PHP
Sandy Smith
 
phptutorial
phptutorialphptutorial
phptutorial
tutorialsruby
 
PHP Basics Ebook
PHP Basics EbookPHP Basics Ebook
PHP Basics Ebook
Swanand Pol
 
phptutorial
phptutorialphptutorial
phptutorial
tutorialsruby
 
Php introduction
Php introductionPhp introduction
Php introduction
krishnapriya Tadepalli
 
PHP: The easiest language to learn.
PHP: The easiest language to learn.PHP: The easiest language to learn.
PHP: The easiest language to learn.
Binny V A
 
Chap1introppt2php(finally done)
Chap1introppt2php(finally done)Chap1introppt2php(finally done)
Chap1introppt2php(finally done)
monikadeshmane
 
FYBSC IT Web Programming Unit IV PHP and MySQL
FYBSC IT Web Programming Unit IV  PHP and MySQLFYBSC IT Web Programming Unit IV  PHP and MySQL
FYBSC IT Web Programming Unit IV PHP and MySQL
Arti Parab Academics
 
05php
05php05php
php fundamental
php fundamentalphp fundamental
php fundamental
zalatarunk
 

Similar to Dig1108C Lesson 2 (20)

Training on php by cyber security infotech (csi)
Training on  php by cyber security infotech (csi)Training on  php by cyber security infotech (csi)
Training on php by cyber security infotech (csi)
 
Php mysql
Php mysqlPhp mysql
Php mysql
 
Php
PhpPhp
Php
 
Advanced Perl Techniques
Advanced Perl TechniquesAdvanced Perl Techniques
Advanced Perl Techniques
 
What's new, what's hot in PHP 5.3
What's new, what's hot in PHP 5.3What's new, what's hot in PHP 5.3
What's new, what's hot in PHP 5.3
 
WT_PHP_PART1.pdf
WT_PHP_PART1.pdfWT_PHP_PART1.pdf
WT_PHP_PART1.pdf
 
Introduction to php basics
Introduction to php   basicsIntroduction to php   basics
Introduction to php basics
 
PHP Workshop Notes
PHP Workshop NotesPHP Workshop Notes
PHP Workshop Notes
 
Was können wir von Rebol lernen?
Was können wir von Rebol lernen?Was können wir von Rebol lernen?
Was können wir von Rebol lernen?
 
Introduction to Modern Perl
Introduction to Modern PerlIntroduction to Modern Perl
Introduction to Modern Perl
 
Intro to PHP
Intro to PHPIntro to PHP
Intro to PHP
 
phptutorial
phptutorialphptutorial
phptutorial
 
PHP Basics Ebook
PHP Basics EbookPHP Basics Ebook
PHP Basics Ebook
 
phptutorial
phptutorialphptutorial
phptutorial
 
Php introduction
Php introductionPhp introduction
Php introduction
 
PHP: The easiest language to learn.
PHP: The easiest language to learn.PHP: The easiest language to learn.
PHP: The easiest language to learn.
 
Chap1introppt2php(finally done)
Chap1introppt2php(finally done)Chap1introppt2php(finally done)
Chap1introppt2php(finally done)
 
FYBSC IT Web Programming Unit IV PHP and MySQL
FYBSC IT Web Programming Unit IV  PHP and MySQLFYBSC IT Web Programming Unit IV  PHP and MySQL
FYBSC IT Web Programming Unit IV PHP and MySQL
 
05php
05php05php
05php
 
php fundamental
php fundamentalphp fundamental
php fundamental
 

More from vc-dig1108-fall-2013

DIG1108 Lesson 8
DIG1108 Lesson 8DIG1108 Lesson 8
DIG1108 Lesson 8
vc-dig1108-fall-2013
 
DIG1108 Lesson 7
DIG1108 Lesson 7DIG1108 Lesson 7
DIG1108 Lesson 7
vc-dig1108-fall-2013
 
DIG1108 Lesson 6
DIG1108 Lesson 6DIG1108 Lesson 6
DIG1108 Lesson 6
vc-dig1108-fall-2013
 
DIG1108 Lesson 5
DIG1108 Lesson 5DIG1108 Lesson 5
DIG1108 Lesson 5
vc-dig1108-fall-2013
 
DIG1108 Lesson 4
DIG1108 Lesson 4DIG1108 Lesson 4
DIG1108 Lesson 4
vc-dig1108-fall-2013
 
Dig1108 Lesson 3
Dig1108 Lesson 3Dig1108 Lesson 3
Dig1108 Lesson 3
vc-dig1108-fall-2013
 
Dig1108 c lesson1
Dig1108 c lesson1Dig1108 c lesson1
Dig1108 c lesson1
vc-dig1108-fall-2013
 

More from vc-dig1108-fall-2013 (7)

DIG1108 Lesson 8
DIG1108 Lesson 8DIG1108 Lesson 8
DIG1108 Lesson 8
 
DIG1108 Lesson 7
DIG1108 Lesson 7DIG1108 Lesson 7
DIG1108 Lesson 7
 
DIG1108 Lesson 6
DIG1108 Lesson 6DIG1108 Lesson 6
DIG1108 Lesson 6
 
DIG1108 Lesson 5
DIG1108 Lesson 5DIG1108 Lesson 5
DIG1108 Lesson 5
 
DIG1108 Lesson 4
DIG1108 Lesson 4DIG1108 Lesson 4
DIG1108 Lesson 4
 
Dig1108 Lesson 3
Dig1108 Lesson 3Dig1108 Lesson 3
Dig1108 Lesson 3
 
Dig1108 c lesson1
Dig1108 c lesson1Dig1108 c lesson1
Dig1108 c lesson1
 

Recently uploaded

“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 

Recently uploaded (20)

“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 

Dig1108C Lesson 2

  • 1. INTRO TO SERVER-SIDE PROGRAMMING Friday, September 6, 13
  • 2. PHP As A Language PHP can be treated as a distinct language with it’s own rules It has it’s own vocabulary - words that are familiar to the language PHP has distinct grammatical rules Syntax - rules to determine the composition of sentences Semantics - the meaning and significance of words Structure - the relationship between words Friday, September 6, 13
  • 3. Grammar and Vocaublary Reserved Words and Keywords: if, else, ifelse; for, foreach, while, do; and, or, xor; public, private, protected Expressions: semicolon (;), curly braces ({...}) Arithmetic: addition (+), subtraction (-), multiplication(*) Comparisons: equality (==), inequalities (!=), ranges (<=) Special cases: dollar($), braces ([...]), operators (&, |, <<) User & Built-in Constants: PHP_VERSION, E_ERROR, E_WARNING, E_NOTICE, MY_CONSTANT User & Built-in Functions: shuffle(), printf(), strlen() Friday, September 6, 13
  • 4. The PHP Manual - http://php.net/manual/en/ In your “assignments” workspace, create a file called “assignment-2.1.md” to work on your answers to the following questions: Find at least three different methods to get a random value from an array with a built-in function (Look in Array Functions) What does the built-in md5() function do? What is the default return value? What built-in functions work similarly? What is another name for “anonymous functions” in PHP and where are they in the manual? When were they added and what was the last feature added? What is the default value of the “memory_limit” setting in PHP? What value would I set to it in order to allocate ALL memory to PHP? How could I set that value and where would I find that in the manual? Friday, September 6, 13
  • 5. Data Types - Literals Literals are also known as Primitive Values Representative of fixed values, such as numbers, text, etc Four scalar types: boolean, integer float (double) & string Two compound types: array & object Three special types: resource, NULL & callable What makes 1 different from 1.0? Friday, September 6, 13
  • 6. Working With Variables Variables are storage locations with identifiers that contain values Variables are places to store your literals. Think of a bucket. $a_variable // This is a bucket to hold literals! $a_variable = “some value” // Now the bucket has stuff in it $a_variable = “something else” // The bucket remains, but a new string is put in it Variables in PHP are always preceded with a dollar sign ($) Variables are not very useful empty, so they are usually followed with an assignment operator Friday, September 6, 13
  • 7. Assignment Operators An operator accepts one or more literals or variables, performs an operation on them and returns the results, like a calculator. $total = 1 // total is defined as 1 $total = $total + 1 // total is now 2 $total += 2 // total is now 4 (old total plus 2) Orders of operation and precedence still apply here! Friday, September 6, 13
  • 8. Basic “Phrases” Variables, basic expressions and comments: $david = ‘awesome’; // not entirely true Basic assignment and arithmetic operators: $counter = 1; $counter = 2; $counter = 1 + 1; $counter += 2; Getting feedback from PHP: echo $counter; var_dump($counter); var_export($counter); Friday, September 6, 13
  • 10. Pulling Files From Git Open your “assignments” workspace in Cloud9 In the console, type “git remote -v” to see the repository URL for the remote named “origin” Connect the “assignments” repository from the class to yours: Go to https://github.com/vcc-dig1108/assignments Copy the repo URL to your clipboard In the Cloud9 console, type “git remote add upstream “ (with the space at the end) and paste the URL that you copied Now “git remote -v” should list “origin” and “upstream” Friday, September 6, 13
  • 11. Pulling Files From Git (cont) To get the updated code from remote use “git fetch” (try with -h) Use “git merge” to roll that update into your local branch You should now have the updated file “homework-2.1.md” All instructions are in the assignment: Open the project that you forked earlier or fork one now Grab around 50 lines of PHP from that project that show examples of literals, variables, function calls and other colored (important) things If there is something that you don’t recognize, note it for later The goal is to practice “reading” PHP grammar for now Friday, September 6, 13