Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /* Pre-defined 'symbols' */
- /* ALL UPPER CASE - use underscore for linking nouns or words */
- define('COMPANY_NAME', 'Chris Baldy PLC');
- define('TELEPHONE_NUMBER', '0161 011 1001');
- /* Variable */
- /* Always start with $ - lower case for the first word, no spaces, starting word thereafter will
- always be upper-case first */
- $header = COMPANY_NAME . ' Call today on: ' . TELEPHONE_NUMBER; /* string type */
- echo $header;
- $header = 'This is not a header'; /* still a string */
- echo PHP_EOL . $header;
- $header = 22.44 * 22; /* number */
- echo PHP_EOL . $header;
- /* Variable types */
- /* integers - whole numbers */
- /* strings - collections of letters */
- /* floats - real number */
- /* objects - mixed types */
- /* arrays - mixed types */
- if(COMPANY_NAME === 'Chris Baldy PLC') {
- echo PHP_EOL . 'Best offers today - call now';
- echo PHP_EOL . 'Extra code';
- } else {
- }
- /* PHP maths */
- /* / - division */
- /* * - multiplication */
- echo PHP_EOL . 10 / 2;
- /* @see https://www.php.net/ */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement