HEScript - using php function inside hescript


Is it possible to use php functions in hescript?
I need base64_encode for now, but don’t know how to use it in hescript

Thank you


No, it’s not possible. You can run HEScript from PHP but not the contrary.


Maybe you could think about add posibility to use internal php.exe because it is just compiled. It could be simple one line commands, but it helps us a lot, because no one is hescript experts :slight_smile:

php -r ‘echo base64_encode(“something”);’


Sure, we’ll check whether this can be done this way.


Please check if in hescript could call script inside compiled application and if return from this script can be assign to hescript variable. It could be powerfull.

SomeVariable := PHP(‘tools.php?var=’ + getglobalvar(‘something’);


Did you think about it if it is possible?


We added the ability to run PHP code in HEScript thanks to the new ExecutePHPScript function.
Example code:

procedure TestRunScript;
 SRes: String;
 SRes := ExecutePHPScript("<?php echo 'TEST'; ?>");



great, I can not wait for the new version :slight_smile:

Can we run php script and output assing to SRes? and how to do is?

procedure TestRunScript;
  SRes: String;
  SRes := ExecutePHPScript("<?php include("test.php") ?>");


It will normally work provided that test.php lies in the application’s root folder (the source folder).


I think that documentation should be fix


There was a HTML cleanup problem in the post-processing… It’s fixed in the online version, thanks!