<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: PHP Echo Vs Print</title>
	<atom:link href="http://www.learnphponline.com/php-basics/php-echo-vs-print/feed" rel="self" type="application/rss+xml" />
	<link>http://www.learnphponline.com/php-basics/php-echo-vs-print</link>
	<description>Learn PHP Online</description>
	<lastBuildDate>Fri, 23 Dec 2011 17:09:11 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
	<item>
		<title>By: ajay</title>
		<link>http://www.learnphponline.com/php-basics/php-echo-vs-print/comment-page-2#comment-15415</link>
		<dc:creator>ajay</dc:creator>
		<pubDate>Wed, 21 Dec 2011 11:20:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.learnphponline.com/?p=24#comment-15415</guid>
		<description>Using “echo” you can print multiple values but the same is not possible with “Print”.</description>
		<content:encoded><![CDATA[<p>Using “echo” you can print multiple values but the same is not possible with “Print”.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anil Tiwari</title>
		<link>http://www.learnphponline.com/php-basics/php-echo-vs-print/comment-page-2#comment-14523</link>
		<dc:creator>Anil Tiwari</dc:creator>
		<pubDate>Fri, 25 Nov 2011 12:10:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.learnphponline.com/?p=24#comment-14523</guid>
		<description>Right Print function is much better and faster from echo...:)</description>
		<content:encoded><![CDATA[<p>Right Print function is much better and faster from echo&#8230;:)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: PHP_Noob</title>
		<link>http://www.learnphponline.com/php-basics/php-echo-vs-print/comment-page-2#comment-13940</link>
		<dc:creator>PHP_Noob</dc:creator>
		<pubDate>Sat, 05 Nov 2011 20:40:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.learnphponline.com/?p=24#comment-13940</guid>
		<description>@already_loving_php

That&#039;s because concatenation is wrong. Echo uses commas and print uses a period.

Example:

&lt;?php
$name = &quot;PHP_Noob&quot;;
$Name = &quot;already_loving_php&quot;;

print &quot;Your name is not $Name&quot;;
echo &quot;&quot; , &quot;Your name is ${name} &quot; , &quot;and not ${Name}&quot;; 
print &quot;&quot;.&quot;Hello www.LEARNPHPONLINE.com!&quot;.&quot;I just began learning PHP.&quot;;
?&gt;

Both practically does the same thing.</description>
		<content:encoded><![CDATA[<p>@already_loving_php</p>
<p>That&#8217;s because concatenation is wrong. Echo uses commas and print uses a period.</p>
<p>Example:</p>
<p>&lt;?php<br />
$name = &quot;PHP_Noob&quot;;<br />
$Name = &quot;already_loving_php&quot;;</p>
<p>print &quot;Your name is not $Name&quot;;<br />
echo &quot;&#8221; , &#8220;Your name is ${name} &#8221; , &#8220;and not ${Name}&#8221;;<br />
print &#8220;&#8221;.&#8221;Hello <a href="http://www.LEARNPHPONLINE.com" rel="nofollow">http://www.LEARNPHPONLINE.com</a>!&#8221;.&#8221;I just began learning PHP.&#8221;;<br />
?&gt;</p>
<p>Both practically does the same thing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian Temecula</title>
		<link>http://www.learnphponline.com/php-basics/php-echo-vs-print/comment-page-2#comment-13455</link>
		<dc:creator>Brian Temecula</dc:creator>
		<pubDate>Mon, 03 Oct 2011 02:11:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.learnphponline.com/?p=24#comment-13455</guid>
		<description>There is one case where echo cannot do what print can:

$Lord = &#039;Jesus&#039;;
isset( $Lord ) and print $Lord;</description>
		<content:encoded><![CDATA[<p>There is one case where echo cannot do what print can:</p>
<p>$Lord = &#8216;Jesus&#8217;;<br />
isset( $Lord ) and print $Lord;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kanna</title>
		<link>http://www.learnphponline.com/php-basics/php-echo-vs-print/comment-page-2#comment-13391</link>
		<dc:creator>kanna</dc:creator>
		<pubDate>Wed, 28 Sep 2011 02:56:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.learnphponline.com/?p=24#comment-13391</guid>
		<description>this is because print returns a int value and echo returns no value / a void value.

otherwise there is no difference between print and echo. if your splitting hairs considering scipt parsing speed then you should stick to echo.</description>
		<content:encoded><![CDATA[<p>this is because print returns a int value and echo returns no value / a void value.</p>
<p>otherwise there is no difference between print and echo. if your splitting hairs considering scipt parsing speed then you should stick to echo.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: steve</title>
		<link>http://www.learnphponline.com/php-basics/php-echo-vs-print/comment-page-2#comment-13373</link>
		<dc:creator>steve</dc:creator>
		<pubDate>Mon, 26 Sep 2011 16:55:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.learnphponline.com/?p=24#comment-13373</guid>
		<description>The main differences between the two is that ECHO is a construct, as such it cannot be used in an expression whereas print can.

Also, you cannot use echo if your executing your php script via CLI.</description>
		<content:encoded><![CDATA[<p>The main differences between the two is that ECHO is a construct, as such it cannot be used in an expression whereas print can.</p>
<p>Also, you cannot use echo if your executing your php script via CLI.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: activeseven</title>
		<link>http://www.learnphponline.com/php-basics/php-echo-vs-print/comment-page-2#comment-12865</link>
		<dc:creator>activeseven</dc:creator>
		<pubDate>Sun, 21 Aug 2011 20:41:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.learnphponline.com/?p=24#comment-12865</guid>
		<description>The main differences between the two is that ECHO is a construct, as such it cannot be used in an expression whereas print can.

Also, you cannot use echo if your executing your php script via CLI.</description>
		<content:encoded><![CDATA[<p>The main differences between the two is that ECHO is a construct, as such it cannot be used in an expression whereas print can.</p>
<p>Also, you cannot use echo if your executing your php script via CLI.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chirag nandaniya</title>
		<link>http://www.learnphponline.com/php-basics/php-echo-vs-print/comment-page-2#comment-12251</link>
		<dc:creator>chirag nandaniya</dc:creator>
		<pubDate>Mon, 04 Jul 2011 08:45:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.learnphponline.com/?p=24#comment-12251</guid>
		<description>echo vs print.

echo does not return a value but print return 1.

try these statements separately and see the difference.

print (echo “Hello World”);

echo (print “Hello World”);</description>
		<content:encoded><![CDATA[<p>echo vs print.</p>
<p>echo does not return a value but print return 1.</p>
<p>try these statements separately and see the difference.</p>
<p>print (echo “Hello World”);</p>
<p>echo (print “Hello World”);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ravi Shankar</title>
		<link>http://www.learnphponline.com/php-basics/php-echo-vs-print/comment-page-2#comment-11782</link>
		<dc:creator>Ravi Shankar</dc:creator>
		<pubDate>Wed, 01 Jun 2011 06:55:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.learnphponline.com/?p=24#comment-11782</guid>
		<description>echo and print have difference.

echo does not return a value but print return 1.

try these statements  separately and see the difference.

print (echo &quot;Hello World&quot;);

echo (print &quot;Hello World&quot;);</description>
		<content:encoded><![CDATA[<p>echo and print have difference.</p>
<p>echo does not return a value but print return 1.</p>
<p>try these statements  separately and see the difference.</p>
<p>print (echo &#8220;Hello World&#8221;);</p>
<p>echo (print &#8220;Hello World&#8221;);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gaje</title>
		<link>http://www.learnphponline.com/php-basics/php-echo-vs-print/comment-page-2#comment-11577</link>
		<dc:creator>Gaje</dc:creator>
		<pubDate>Sat, 14 May 2011 17:01:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.learnphponline.com/?p=24#comment-11577</guid>
		<description>@bunny -

using echo will write the output to the screen, you wouldn&#039;t use it to generate javascript code, unless you want to write script to the screen for some reason. If that&#039;s the case, make sure you put it in &lt;code&gt;&lt;/code&gt; tags.

And why would you want to assign that php variable into your javascript? You&#039;re better off just plugging that variable directly into your html form field:

&lt;input type=&quot;text&quot; name=&quot;txt1&quot; value=&quot;&quot; /&gt;</description>
		<content:encoded><![CDATA[<p>@bunny -</p>
<p>using echo will write the output to the screen, you wouldn&#8217;t use it to generate javascript code, unless you want to write script to the screen for some reason. If that&#8217;s the case, make sure you put it in <code></code> tags.</p>
<p>And why would you want to assign that php variable into your javascript? You&#8217;re better off just plugging that variable directly into your html form field:</p>
<p>&lt;input type=&quot;text&quot; name=&quot;txt1&quot; value=&quot;&#8221; /&gt;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

