PHP Snippets: Echo

PHPThis post is part of the PHP Snippets series where I will be covering the basics of developing in PHP.

Almost everything you write in PHP ill have an output to the user; the simplest way of doing this is to use the in-built echo function (which you can use with or without parentheses).

The below example is a simple echo to output one line of text:

echo 'Hello world!';

You can output multiple lines of text, which you would do with multiple echo function calls:

echo 'Hello world!<br />';
echo 'This is a simple PHP example.';

Notice though, there is a HTML break line tag <br /> included at the end of the first line; if this wasn’t present, then both lines would be output on the same row.

Can ISC Software Solutions help?

ISC Software Solutions are UK and Ireland based experts on Microsoft Dynamics GP. If you’d like to speak to someone about support, consultancy, upgrades, implementation, development, GP Elementz add-ons or portals, or anything else Dynamics GP related, you can use the form below.





Your Name (required):
Your Email (required):
Subject:
Enquiry message:

What should we write about next?





Your Name (required) –
Your Email (required) –

Leave a Reply

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