Assignment035 - Datatypes
Variables and constants hold specific datatypes. These include:
- Boolean: Holds true or false values (1 or 0).
- Integer: Holds numbers with no decimals, such as -10, 0, 5, 10, etc.
- Double: Holds decimals numbers (Floats), such as 9.25 and 10.2528.
- String: Holds characters, such as "Car", "Toe", "7-11 Stores" and "9-11."
- Array: See Arrays.
- Object: See Objects.
- Resource: See MySQL.
- Null: Holds the value NULL.
For example:Datatypes
<html>
<head>
<title>Datatypes.php</title>
</head>
<body>
<?php
//Online Banking Balance Display
//Set the variables
$yearsofservice=10; //integer
$balance=115000.00; //double
$message = "Welcome to Bank of Coalinga."; //string
$vip=true; //boolean
//Display browser output
print("<h1>".$message."</h1>");
print("Your balance is ".$balance);
print("<br><br>");
print("VIP Status: ".$vip);
print("<br><br>");
print($yearsofservice." year customer.");
?>
</body>
</html>