newby question : function parameter passing

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • amadain

    newby question : function parameter passing

    Help. I'm new to php. I wrote a function that did not seem to work so
    I checked whether the parameter I was passing to the function was
    actually being used. I found that it wasn't. When I run the following
    code I get:

    Testcheck:

    and nothing else. It seems that the variable is not being passed to
    the function. Here is the code:

    function file_write_posi tion($textcheck ) {
    print "Testcheck: " . $testcheck . "<br>\n\n";
    return;
    }

    $testcheck="# Test Call Area";
    file_write_posi tion($testcheck );

    What am I doing wrong??

    A

  • Mike Roetgers

    #2
    Re: newby question : function parameter passing

    amadain schrieb:
    Help. I'm new to php. I wrote a function that did not seem to work so
    I checked whether the parameter I was passing to the function was
    actually being used. I found that it wasn't. When I run the following
    code I get:
    >
    Testcheck:
    >
    and nothing else. It seems that the variable is not being passed to
    the function. Here is the code:
    >
    function file_write_posi tion($textcheck ) {
    print "Testcheck: " . $testcheck . "<br>\n\n";
    return;
    }
    >
    $testcheck="# Test Call Area";
    file_write_posi tion($testcheck );
    >
    What am I doing wrong??
    >
    A
    >
    The parameter is called $textcheck, but you are using $testcheck inside
    the function.

    Comment

    • e_matthes@hotmail.com

      #3
      Re: newby question : function parameter passing

      >
      The parameter is called $textcheck, but you are using $testcheck inside
      the function.
      That's funny! Also, you don't need to include the return statement
      unless you are returning something.

      Comment

      • Michael Fesser

        #4
        Re: newby question : function parameter passing

        ..oO(amadain)
        >Help. I'm new to php. I wrote a function that did not seem to work so
        >I checked whether the parameter I was passing to the function was
        >actually being used. I found that it wasn't. [...]
        Set error_reporting to E_ALL in your php.ini.

        Micha

        Comment

        Working...