473,396 Members | 1,907 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

Feb 26 '07 #1
3 1384
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_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.
Feb 26 '07 #2
>
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.

Feb 26 '07 #3
..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
Feb 26 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: domeceo | last post by:
can anyone tell me why I cannot pass values in a setTimeout function whenever I use this function it says "menu is undefined" after th alert. function imgOff(menu, num) { if (document.images) {...
6
by: Brian Ross | last post by:
Hi, I am trying to do something similar to the following: int Func1(int x, int y); double Func2(double x, double y); template <typename FuncT> // <- What would go here class CObjectT {
39
by: Mike MacSween | last post by:
Just spent a happy 10 mins trying to understand a function I wrote sometime ago. Then remembered that arguments are passed by reference, by default. Does the fact that this slowed me down...
10
by: John Baker | last post by:
Hi: This is the only ASP newsgroup I can access using Verizon, and I would like to know a real basic piece of information. I am totall new to ASP, although I have done HTML coding. Say I The...
14
by: Mike Labosh | last post by:
How do you define whether the return value of a function is ByRef or ByVal? I have a utility class that cleans imported records by doing *really heavy* string manipulation in lots of different...
12
by: Boni | last post by:
Dear all, How can I add something to the VB arrays after the initialization. dim _points() as System.Drawing.points If it is not possible how can I pass into function, with VB array as an...
3
by: Blue Streak | last post by:
Just some basic questions because none of my reference manuals cover this explicitly: 1) If you want have an argument as an array of integers would this be the correct declaration? ...
28
by: Larax | last post by:
Best explanation of my question will be an example, look below at this simple function: function SetEventHandler(element) { // some operations on element element.onclick = function(event) {
10
by: Janus | last post by:
Hi, Is there a way to pass arguments to the callback function used inside an addEventListener? I see that I can only list the name of the callback function. For eg, I use this: var...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.