<HTML ><HEAD ><TITLE >echo</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.44"><LINK REL="HOME" TITLE="PHP Manual" HREF="manual.html"><LINK REL="UP" TITLE="String functions" HREF="ref.strings.html"><LINK REL="PREVIOUS" TITLE="crypt" HREF="function.crypt.html"><LINK REL="NEXT" TITLE="explode" HREF="function.explode.html"></HEAD ><BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >PHP Manual</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="function.crypt.html" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.explode.html" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><H1 ><A NAME="function.echo" >echo</A ></H1 ><DIV CLASS="refnamediv" ><A NAME="AEN25691" ></A >echo -- Output one or more strings.</DIV ><DIV CLASS="refsect1" ><A NAME="AEN25694" ></A ><H2 >Description</H2 ><DIV CLASS="funcsynopsis" ><P ></P ><CODE CLASS="FUNCDEF" >echo</CODE >(string arg1, string [<SPAN CLASS="optional" >argn</SPAN >]... );<P ></P ></DIV ><P > Outputs all parameters. </P ><P > <B CLASS="function" >Echo()</B > is not actually a function (it is a language construct) so you are not required to use parantheses with it. <TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" CLASS="EXAMPLE" ><TR ><TD ><DIV CLASS="example" ><P ><B >Example 1. <B CLASS="function" >Echo()</B > example</B ></P ><TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="100%" ><TR ><TD ><PRE CLASS="programlisting" > 1 2 echo "Hello World"; 3 4 echo "This spans 5 multiple lines. The newlines will be 6 output as well"; 7 8 echo "This spans\nmultiple lines. The newlines will be\noutput as well."; 9 </PRE ></TD ></TR ></TABLE ></DIV ></TD ></TR ></TABLE > </P ><DIV CLASS="note" ><BLOCKQUOTE CLASS="note" ><P ><B >Note: </B > In fact, if you want to pass more than one parameter to echo, you must not enclose the parameters within parentheses. </P ></BLOCKQUOTE ></DIV ><P > See also: <A HREF="function.print.html" ><B CLASS="function" >print()</B ></A >, <A HREF="function.printf.html" ><B CLASS="function" >printf()</B ></A >, and <A HREF="function.flush.html" ><B CLASS="function" >flush()</B ></A >. </P ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="function.crypt.html" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="manual.html" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="function.explode.html" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >crypt</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="ref.strings.html" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >explode</TD ></TR ></TABLE ></DIV ></BODY ></HTML >