Results 1 to 6 of 6

Thread: [RESOLVED] calling function

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2005
    Posts
    1,170

    Resolved [RESOLVED] calling function

    I've got a question how can you call a function that has parameter?

    for example

    function name_function($param)
    {

    // codes

    return $param;
    }

    how can I call that so that it will prints that param out to the page?

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: calling function

    name_function('Hello');

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2005
    Posts
    1,170

    Re: calling function

    but it doesn't print out to the page. Unless I changed the return to echo

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2005
    Posts
    1,170

    Re: calling function

    Wait maybe this function is not a good example. I meant I want to replace that "hello" with "Hi", then I wanna return that Hi not Hello. You dont have to tell me about str_repalce, I just want to know how to call the "return" statement and print the returned value to the page without using echo.

  5. #5
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: calling function

    Well, echo name_function('Hello') then.

    Isn't this... basic?

  6. #6

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2005
    Posts
    1,170

    Re: calling function

    Haha.. oh man.. that's it! sometimes, my mind isn't quite working lol

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width