• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/7

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

7 Cards in this Set

  • Front
  • Back

How does PHP run?

JavaScript generally runs in the browser, or client. This means it only really knows what's going on in your browser, plus whatever information it gets from the website(s) you're connecting to.


PHP, on the other hand, runs on the same computer as the website you're visiting, which is known as theser

What's the command for $emailTo?



$emailTo = "kdickers149@gmail.com";


$subject="I hope this works";


$body= "Yay!";


$headers="From: kelly@mic.com";



mail($emailTo, $subject, $body, $headers);




?>

What's the structure of a PHP for loop?

For loops in PHP:


* A for loop starts with the forkeyword. This tells PHP to get ready to loop!


* Next comes a set of parentheses (()). Inside the parentheses, we tell PHP three things, separated by semicolons (;): where to start the loop; where to end the loop; and what to do to get to the next iteration of the loop (for instance, count up by one).


* After the part in parentheses, the part in curly braces ({}) tells PHP what code to run for each iteration of the loop.

How do you an increment in a loop?

($i++ is shorthand for $i = $i + 1. You'll see this a lot!)

How does a foreach loop work?

The foreach loop is used to iterate over each element of an object—which makes it perfect for use with arrays!


You can think of foreach as jumping from element to element in the array and running the code between {}s for each of those elements.

What's the structure for while loops in PHP?

here the statements in side the curly braces { and } are executed as long as the condition cond is evaluated as true. In the last exercise, condwas the condition that the number of consecutive heads was less than 3: $headCount

Object-oriented programming language

PHP is an object-oriented programming language, which means that you can create objects, which can contain variables and functions.


When talking about objects, you refer to variables belonging to these objects as properties (or attributesor fields), and functions are calledmethods.