For day 2 of 21 in the “PHP Function of the day” series, I’m going to look at echo(). It is basic enough that I kind of already used it in yesterday’s post. Echo just prints a value to the page.
<?php
$numberVar = 123;
$textVar = ‘Joe is here!’;
$arrayVar = array(1, 2, 3);
echo $numberVar;
echo ‘<br />’;
echo $textVar;
echo ‘<br />’;
echo $arrayVar;
?>
You will notice that it is able to output simple values but for the array, it just outputs the text “Array”.