You are here:  » Var into myRecordHandler


Var into myRecordHandler

Submitted by antitrust56 on Thu, 2008-12-04 14:07 in

Hello,

I want to know if it possible to include a var into the function myRecordHandler.

function myRecordHandler($record) {
    echo $record[$var1]."<br>";
}

José

Submitted by support on Thu, 2008-12-04 14:12

Hello José,

Certainly - as long as $var1 is declared global, and is the value of a field name that you are expecting within $record; for example:

$var1 = "MYFIELD";
function myRecordHandler($record) {
  global $var1;
  echo $record[$var1]."<br>";
}

Hope this helps!
Cheers,
David.

Submitted by antitrust56 on Thu, 2008-12-04 14:14

Thanks, it works perfectly.