Advertisement
Guest User

Untitled

a guest
Jan 17th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.87 KB | None | 0 0
  1. <html>
  2. <body>
  3. <?php echo "<h1>Hello world!</h1>"; ?>
  4. <?php echo "Welcome to <b>Penn State</b>!<br>";
  5.     echo "We are <span style=\"color:red\"> Penn State</span>! <br>";
  6.     $x = 5;
  7.     $pi = 3.14;
  8.     $foo = True;
  9.     $name = "George";
  10.     $Name = "Sarah";
  11.    
  12.     //$x is casted to a string
  13.     echo "x is $x<br>";
  14.     echo "pi is $pi<br>";
  15.     echo "name is \"$name\"<br>";
  16.     echo "name is \"$Name\"<br>";
  17.    
  18.     $z = $x + $pi;
  19.     $z1 = $x * $pi;
  20.     echo "z is $z<br>";
  21.     echo "z1 is $z1<br>";
  22.    
  23.     if ($x>$pi)
  24.     {
  25.         echo "x is greater than pi<br>";
  26.     }
  27.     else
  28.     {
  29.         echo "x is smaller than pi<br>";
  30.     }
  31.    
  32.    
  33.     if ($x==$pi)
  34.     {
  35.         echo "x is equal to pi<br>";
  36.     }
  37.     else
  38.     {
  39.         echo "x is not equal to pi<br>";
  40.     }
  41.    
  42.     echo "Today is: ".date("m/d/y")."<br>";
  43.    
  44.     echo "a random number in [1,10]: ".rand(1,10)."<br>";
  45.     echo "The length of string \"name\" is ".strlen($name);
  46.     ?>
  47. </body>
  48. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement