Français
  • PHP Tutorial - 17 - Return Values


    Added on Sunday 20 July 2008 13:01:07
    by thenewboston
    38323 Views
    4.9 / 5
    12345
    127 rates
    Send this video to your friends
    Get embed code of video

    Go to my website http://thenewboston.com/ if you need any help or have any questions. I will answer them all there!

    Subscribe if you like my videos!



    facebook
  • Write your comment here...
  • frankkoq

    muchas gracias (Y)
    Wednesday 07 December 2011 18:23:34
  • aditya8080993750

    @envy power Yes u can like this fumction($var, $vare)
    Wednesday 07 December 2011 12:43:13
  • Hersh715

    u should be a programming professor at Stanford! 
    Monday 10 October 2011 00:40:40
  • kojax98

    you explain everything well, but my problem is that now, I don't remember syntaxes for statments, I mean when I watched this video I knew everything from it but now I can't remember Do, While or For loops...
    Tuesday 20 September 2011 03:49:37
  • masa992

    php has alot in common with C....but its easyer than C ofc
    Sunday 01 May 2011 06:39:47
  • hammadghulam

    let me returnnnnnnnnnnnnnnnnnnnnnnn
    Saturday 02 April 2011 14:11:59
  • ninjakid09x

    Knowing Lua and VB made me already know about functions parametres and etc.. though your tutorials are very nicely done and I am actually understanding PHP more now. Thanks. :)
    Tuesday 25 January 2011 02:56:18
  • m0gria

    @Diifusal no, it isnt! If you write echo $total, the text will be echoed. If you return $total, you can use the value of $total, outside of the function.
    Wednesday 05 January 2011 07:23:48
  • Jozekban

    so what's the diffrence between echo $lol which &lol = &a +&b and return &lol which &lol = &a +&b
    Tuesday 04 January 2011 14:55:36
  • DR01D5

    @Diifusal It's not the same. You only use echo if you want it to appear on the website. For most of the functions you definitely don't want that. So you probably just want to continue working with the result "behind the scenes"
    Monday 03 January 2011 16:37:08
  • Diifusal

    why do you use return? isn't it the same as using echo $total?
    Sunday 02 January 2011 11:17:44
  • lonelystarpaolo

    if I really want to add those numbers can I just use the one on the past tutorials... the one with the basic math...
    Thursday 02 December 2010 23:50:24
  • COMMANO38

    @JonnyJC93 Its just an example. Your not getting the point, he's teaching you how to return variables. You would never use this function, just an example.
    Sunday 21 November 2010 02:25:37
  • MisterJ4512

    @admiral3131 echo prints something on the scree, return "brings" something from a function / variable
    Friday 24 September 2010 12:00:32
  • eetufck

    Basically, when you use the return function it returns whatever variable that follows the return statement. That is, when he echoed add(12, 343), the value that got put into the echo function is the value of $total which was $a + $b. He could have just as easily typed: $newVariable = add(12, 343); echo $newVariable;
    Thursday 23 September 2010 03:58:19
  • arlkweith

    many thanks for tutorials
    Thursday 16 September 2010 06:34:49
  • tdhashan

    Thanks a lot dear... God bless u Honestly !!! U are Best !!!!!!
    Tuesday 31 August 2010 21:17:44
  • jovenmedia

    real nice champion
    Friday 20 August 2010 14:14:54
  • Admiral3131

    What's the difference between return and echo?
    Friday 13 August 2010 15:40:14
  • TheRealAuxiliary

    @JonnyJC93 to make it changeble :D
    Thursday 15 July 2010 10:17:08
  • JonnyJC93

    im confused..... why do you need to do this to add numbers when you can put echo *number*+*number*
    Sunday 11 July 2010 10:58:05
  • diangelisj

    hi dude, thanks for lessons. =]
    Monday 28 June 2010 09:35:20
  • mangoprojects

    thank you. - behind vfx
    Friday 11 June 2010 18:36:46
  • after731

    Hmmm so when you use 'return' you need to add 'echo' to print the function?
    Monday 07 June 2010 08:28:36
  • TheErroneousOne

    Oh! How embarrassing!
    Sunday 30 May 2010 04:24:53
ADVERTISEMENT
Supplements
Social Network
Tag cloud