« Back to Product

Documentation

IPS_RunScriptTextEx

 bool IPS_RunScriptTextEx (string $ScriptText, array $Parameter) 

Parameters

ScriptText

String that is executed as script

Parameter

Key (string) => Value (variant) Pairs that can be accessed in the executed script

Returns

If the function succeeds, it returns TRUE, otherwise FALSE.

Description

The function starts a script with the content ScriptText. It is not necessary to state PHP tags.

When using IPS_RunScriptTextEx, the script is executed in its own context. Thus, it does not have access to the variables of the calling script except for the passed parameters. Additional data can only be exchanged via external variables. The function is suited for situations where a script needs to be executed soon but does not require the context of the calling script. The runtime of the calling script does not change as both scripts are executed simultaneously.

The array Parameter can contain any number of "Key => Value" pairs (see PHP Arrays). Each pair is available in the called script in the global variable __$_IPS at the index Key with its content Value__.

Example

// Prints "Hello World" in the message view
IPS_RunScriptTextEx('echo $_IPS["start"] . " ".  $_IPS["end"];', Array("start" => "Hello", "end" => "World"));
Any questions?