EXECPHP()
From Lianjapedia
Revision as of 10:12, 28 March 2017 by Yvonne.milne (Talk | contribs)
Contents
Purpose
Function to run PHP code
Syntax
EXECPHP(<expC>)
See Also
COMPILE, EXEC(), EXECJAVASCRIPT(), EXECPYTHON(), EXECSCRIPT()
Description
The EXECPHP() function runs PHP code. The lines of code are contained in <expC>, which can be a text constant, a filename, a character variable, or a character or memo field. The EXECPHP() function can handle blocks of code. Individual lines of code must be separated by a CHR(13) carriage return character. If a filename.php is specified it is loaded and executed.
Example
create table if not exists scripts (script char(200)) if not used("scripts") use scripts endif select scripts append blank replace script with 'for ($i = 1; $i <= 10; $i++) {' + CHR(13) + '// process commands;'; + CHR(13) + '}' + CHR(13) execphp(script) // Text constant execphp('for ($i = 1; $i <= 10; $i++) {' + CHR(13) + '// process commands;'; + CHR(13) + '}' + CHR(13)) // Memory variable m_script = 'for ($i = 1; $i <= 10; $i++) {' + CHR(13) + '// process commands;'; + CHR(13) + '}' + CHR(13) execphp(m_script)