Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- whatIsToday();
- function whatIsToday() {
- echo 'Date ' . date('l');
- }
- echo '<br />';
- function testFunction($test, $test1 = 50) {
- echo $test . ' ' . $test1;
- }
- testFunction('test', 100);
- echo '<br /><br />';
- function getSum($num1, $num2) {
- $sum = $num1 + $num2;
- echo 'The sum of num1 and num2 is: ' . $sum;
- }
- getSum(45, 5);
- echo '<br /><br />';
- function textStyle($font, $fontSize = 1.5) {
- echo '<h1 style="font-family: ' . $font . '; font-size:'.$fontSize . 'em;">This is Text</h1>';
- // echo '<h1 style="font-family: {$font}; font-size: {$fontSize}em;">This is Text</h1>';
- }
- textStyle('Arial', 3);
- echo '<br /><br />';
- function displaySum($num1, $num2) {
- $total = $num1 + $num2;
- return $total;
- }
- echo displaySum(43, 45);
- echo '<br /><br />';
- function divideNumbers($dividend, $divisor) {
- $quotent = $dividend / $divisor;
- $array = [$dividend, $divisor, $quotent];
- return $array;
- }
- list($var1, $var2, $var3) = divideNumbers(20, 5);
- echo $var1 . ' is divided by ' . $var2 . ' and the quotent is: ' . $var3;
Advertisement
Add Comment
Please, Sign In to add comment