php_variables
This is an old revision of the document!
Table of Contents
PHP Variables
- The second Roger/Charles class, on Oct. 14, 2022.
Variables
What's a variable and what can you do with it?
First, we already saw we can store something from readLine() in a variable:
<?php $n = readLine("What is your name? "); $f = readLine("What is your favourite fruit? "); echo "Hello, Mr. "; echo $n . "!\n"; echo "Do you want to eat " . $f . "?\n"; ?>
Integers
We can also store numbers.
<?php $a = 5172; $b = 171; echo $a * $b; echo "\n"; ?>
php_variables.1728191565.txt.gz · Last modified: 2024/10/06 05:12 by appledog