Parse Error - PHP - Simple .. I hope - unexpected '$'
Posted: Thu Sep 21, 2006 9:54 pm
I am messing around with PHP, and I seem to be getting the error of:
Also in the body of the PHP file (let's call it index.php - what the user will see), I have called the function using:
Let me know if you can see the error .. I can't .. And I am running off of 4 hours of sleep .. so it could just be minor .. someone ... please .. thanks 
There error is actually on "line 5", which in the case of the extra code and such, "line 5" seems to be:parse error, unexpected '$', expecting '&' or T_VARIABLE
Here is the whole script:function addIt($1) {
Code: Select all
function addIt($1) {
$1 = 0;
if ($1 == 1) {
echo "This would be true";
}
elseif ($1 == 0) {
echo "This would be false";
}
else {
echo "I encountered an error";
}
return $1;
}Code: Select all
<?php addIt(0); ?>