Jump to content


Photo

How many returns() can a function have


  • Please log in to reply
2 replies to this topic

#1 taps128

taps128
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 27 April 2006 - 12:23 PM

Hi, all

I wanna write a function that returns several results. how man results can a function have?

#2 ober

ober
  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 27 April 2006 - 12:26 PM

Functions normally only return one item. However, I believe you could return an array of items.

You may also want to look into a class for returning multiple items.

Info: PHP Manual


#3 Orio

Orio
  • Staff Alumni
  • Advanced Member
  • 2,491 posts

Posted 27 April 2006 - 12:42 PM

As if you will look here:
[a href=\"http://www.php.net/manual/en/function.return.php\" target=\"_blank\"]http://www.php.net/manual/en/function.return.php[/a]
You will see that: "the return() statement immediately ends execution of the current function, and returns its argument as the value of the function call".
But as ober said, you can use arrays.

Orio.
Think you're smarty?

(Gone until 20 to November)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users