This site is mobile accessible. Press the "Tap Here" button to use a different font-size.


Smartphone icons created by Freepik - Flaticon

PHP Functions

Default Argument Value

The height is : 350
The height is : 50
The height is : 135
The height is : 80

// declare strict mode placed on the first line of the file
<?php declare(strict_types=1); // strict requirement ?>
<!DOCTYPE html>

<?php
// declare function with default value
function setHeight(int $minheight = 50) {
  echo "The height is : $minheight <br>";
}

// loops through the values
setHeight(350);
setHeight(); // uses the default value
setHeight(135);
setHeight(80);
?>