Exforsys

Free Training

Return Value

This is a discussion on Return Value within the PHP forums, part of the Programming Talk category; I have tried many times echo() function in PHP. But since echo returns the value to screen I get a ...

Go Back   Exforsys > Programming Talk > PHP

Exforsys.com

  #1 (permalink)  
Old 05-10-2007, 03:03 PM
Senior Member
 
Join Date: Apr 2006
Posts: 125
ashlee is on a distinguished road
Return Value

I have tried many times echo() function in PHP. But since echo returns the value to screen I get a doubt whether echo() function have a return value associated with it? If so what would be its type. Also if echo have a return value associated with it can we assign this to variable and use it in our PHP script further.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 05-13-2007, 09:55 AM
Senior Member
 
Join Date: Apr 2006
Posts: 122
rachelle is on a distinguished road
Both echo() and echo represents same thing in PHP. This is because of the simple fact that echo is not a function as many of us think. It is actually a language construct. Either syntax holds good and valid with respect to echo in PHP. Coming to your doubt of whether echo returns value. echo surely does not have any return value associated with it. Since it outputs the given
expression or value on screen does not mean that it has return value associated with it. In fact this is the major difference between echo and print(). That is print() is a function and it has a return value associated with it which you can assign to a variable. But in contrast echo is not a function and is a language construct and also does not have a return value associated with it.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
Return Type Adrian Java 3 02-16-2007 09:41 AM
comp.lang.c Answers (Abridged) to Frequently Asked Questions (FAQ) Steve Summit Tech FAQ 0 06-15-2004 06:00 AM
comp.lang.c Answers (Abridged) to Frequently Asked Questions (FAQ) Steve Summit Tech FAQ 0 06-01-2004 06:01 AM
comp.lang.c Answers to Frequently Asked Questions (FAQ List) Steve Summit Tech FAQ 0 06-01-2004 06:00 AM
Motif FAQ (Part 4 of 9) Ken Lee Tech FAQ 0 04-18-2004 08:54 AM


All times are GMT -4. The time now is 07:07 AM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
Copyright 2004 - 2009 Exforsys Inc. All rights reserved.