• You are not logged in. | Login

Post a reply

  • Index
  •  » Help me!
  •  » how can i make a function that returns multiple values?

November 16, 2006 8:49 pm

franzkafka
Member
Ranks

how can i make a function that returns multiple values?

hi i've got a script im working on and i'm tryign to make a functiont that when sent a timestamp returns a date, the day of the week, and the difference between that date and now

i want to just send the time() to the function and get back all the data to use in my page

i know how to compute all of the values individually but i want to put them all in the same function so i can get back all of the values at the same time


please  help!


 

 

November 23, 2006 1:38 pm

senjor_itc
Member
Ranks

Re: how can i make a function that returns multiple values?

Hi!

try this:

<?php

function foo($bar){
   $ret['time'] = $bar;
   $ret['date'] = $bar . '!';
   return $ret;
}

?>

That's all!


 

 
  • Index
  •  » Help me!
  •  » how can i make a function that returns multiple values?
  • Actions
  • Top
ITCrimea. Ukraine Web Development Company. Professional Developers and Web Designers Team
Custom Web Designs, Internet Applications, E-Commerce Websites, Interactive Sites, Database-Driven Sites and Services