prateek prateek - 1 year ago 110
PHP Question

PHP undefined variable and function name must be a string error


function F($X, $Y, $Z)
$X = hexdec($X);
$Y = hexdec($Y);
$Z = hexdec($Z);
$calc = (($X & $Y) | ((~ $X) & $Z)); // X AND Y OR NOT X AND Z
return $calc;

echo $cal;

i keep getting an error. Undefined variable: F and that function name must be a string.

Answer Source

Only call function using its name

You do not need to add $ before any function name:

$cal = F($B,$C,$D);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download