Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

function parse error

Status
Not open for further replies.

TheGreenOne

Programmer
Jan 11, 2003
56
US
Hi All,
I'm a php newbe.
What is wrong with this php function?

function testfunction (arg1) {
$avar=arg1;
}

I am getting this error:
Parse error: parse error, unexpected T_STRING, expecting ')' in /homepages/7/d92446751/htdocs/proj/connect.php on line 27

the function starts on line 27.
it is in the header of a php file.
it is within <?php ?>
 
It should read:
Code:
function($arg1)
{
  $avar = $arg1;
}

All variables in PHP start with a dollar sign "$".

Ken
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top