Was spricht gegen folgendes...
Delphi-Quellcode:
function PHPCalc(x, y:string):string;
var psvPHP:TpsvPHP;
vx, vy, vz:TPHPVariable;
begin
psvPHP:=TpsvPHP.Create(nil);
try
psvPHP.DLLFolder:='c:\programme\php\';
vx:=psvPHP.Variables.Add;
vx.Name:='x';
vx.Value:='2';
vy:=psvPHP.Variables.Add;
vy.Name:='y';
vy.Value:='3';
vz:=psvPHP.Variables.Add;
vz.Name:='z';
vz.Value:='';
psvPHP.RunCode('$z = $x + $y;');
Result := psvPHP.VariableByName('z').Value;
finally
psvPHP.free;
end;
end;
Gruss
Thorsten