PHP Strings Primer - Displaying Strings
(Page 7 of 37 )
The most common reason we deal with strings at all is to display them. After all the manipulation and formatting takes place, normally our ultimate goal with strings is to present them in some fashion. It is therefore necessary to precede the majority of content in this tutorial with an explanation on how to display strings. We will examine the three most common methods used to display strings, as well as the different options that each provides.
echo(string) -There are several different ways to use the echo construct. We will inspect each of these in detail.print(string) -The syntax and use of print is almost identical to echo, but there are minor differences. We will examine how print differs and when to use it.printf(format [,args...]) -This function allows you to specify rigid formatting rules for displaying a string.
Next: echo >>
More Programming Basics Articles
More By Matt Wade