PHP/Assignment Answers
< PHP
Introduction to PHP
editToday's assignment was to create a function that takes a name, an age, and a height, and outputs a sentence using all of these variables. Also, to call the function using a combination of variables and literals.
Without further ado, let's take a look at the script:
<?php function describeperson($name, $age, $height) { echo 'Did you know that ' . $name . ' is ' . $age . ' years old, and only ' . $height . ' tall?'; } describeperson('John Doe', '22', '5ft'); ?>