Documentation

parseFunction

object
oBXEditorUtils.PHPParser.parseFunction(
 string sCode
);

The method takes a string containing a PHP function call and returns the string with the function name and parameters.

parseFunction can be used to simplify the PHP code parsing when creating a PHP parser.

Parameters:

Parameter Description
sCode A string with the function call.

Returned values

Returns an object having the following properties:

Type Property Description
string name The function name.
string params The string containing parameters passed to the function.

The method returns false if the string does not comply with the specified format.

See also

parseParameters.

Example

<script> var sCode = 'MyPHPFunction("param",$var)'; var oFunc = oBXEditorUtils.PHPParser.parseFunction(sCode); //oFunc.name = 'MyPHPFunction'; //oFunc.params = '"param",$var'; </script>
© «Bitrix24», 2001-2024
Up