Introduction to PHP 8/13

Variables
So far we've been outputting strings and doing math.
To do more complex coding, we need a way to "save" these values. We can do this usingvariables. A variable can store a string or a number, and gives it a specific case-senstive name.
Examples:
  • $myName = "Beyonce";
  • $myAge = 32;
All variable names in PHP start with a dollar sign ( $ ).
Instructions
On line 8, create a variable named $myNameand set it equal to your name. Make sure to end your PHP code with a semicolon.
Introduction to PHP 8/13
<!DOCTYPE html>
<html>
    <head>
    </head>
    <body>
        <p>
          <?php
          $myName = "Beyonce";
          $myAge = 32;
          ?>
        </p>
    </body>
</html>

Comments

Popular posts from this blog

MEGA 暫存檔案刪除

IOS GCD多執行緒

利用CMD指令強制刪除