PHP function of the day: echo()

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;

?>

 

See the output

 

You will notice that it is able to output simple values but for the array, it just outputs the text “Array”.

Leave a Reply

Your email address will not be published. Required fields are marked *