Connecting Tech Pros Worldwide Help | Site Map

newby question : function parameter passing

 
LinkBack Thread Tools Search this Thread
  #1  
Old February 26th, 2007, 12:05 PM
amadain
Guest
 
Posts: n/a
Default 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_position($textcheck) {
print "Testcheck: " . $testcheck . "<br>\n\n";
return;
}

$testcheck="# Test Call Area";
file_write_position($testcheck);

What am I doing wrong??

A


  #2  
Old February 26th, 2007, 12:05 PM
Mike Roetgers
Guest
 
Posts: n/a
Default Re: newby question : function parameter passing

amadain schrieb:
Quote:
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_position($textcheck) {
print "Testcheck: " . $testcheck . "<br>\n\n";
return;
}
>
$testcheck="# Test Call Area";
file_write_position($testcheck);
>
What am I doing wrong??
>
A
>
The parameter is called $textcheck, but you are using $testcheck inside
the function.
  #3  
Old February 26th, 2007, 05:05 PM
e_matthes@hotmail.com
Guest
 
Posts: n/a
Default Re: newby question : function parameter passing

Quote:
>
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.

  #4  
Old February 26th, 2007, 08:15 PM
Michael Fesser
Guest
 
Posts: n/a
Default Re: newby question : function parameter passing

..oO(amadain)
Quote:
>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
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.