Exforsys

Online 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

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-10-2007, 04: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
  #2 (permalink)  
Old 05-13-2007, 10: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
Reply

Thread Tools

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 10:41 AM
comp.lang.c Answers (Abridged) to Frequently Asked Questions (FAQ) Steve Summit Tech FAQ 0 06-15-2004 07:00 AM
comp.lang.c Answers (Abridged) to Frequently Asked Questions (FAQ) Steve Summit Tech FAQ 0 06-01-2004 07:01 AM
comp.lang.c Answers to Frequently Asked Questions (FAQ List) Steve Summit Tech FAQ 0 06-01-2004 07:00 AM
Motif FAQ (Part 4 of 9) Ken Lee Tech FAQ 0 04-18-2004 09:54 AM


All times are GMT -4. The time now is 10:37 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2004 - 2007 Exforsys Inc. All rights reserved.