Bitrix Site Manager

oBXEditorUtils.PHPParser.getParams

array
oBXEditorUtils.PHPParser.getParams(
 string sCode
);

The oBXEditorUtils.PHPParser.getParams method takes comma-separated parameters and returns an array of string values. This method cannot be used to process arrays.

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

Parameters:

Parameter Description
sCode The string in the following format:
param1[,param2[,...,paramN]]

Return Values

Returns an array of string values.

See also

parseParameters.

Example


<script>

var sCode1 = '2,"text text text",5,"N"';
var sCode2 = 'array("LID"=>"en","TEXT"=>"text text text","PAYED"=>"N","CANCELED"=>"N")';
	   
arParams1 = oBXEditorUtils.PHPParser.getArray(sCode1); 
//arParams[0] = '2';
//arParams[1] = '"text text text"';
//arParams[2] = '5';
//arParams[3] = '"N"';

arParams2 = oBXEditorUtils.PHPParser.getArray(sCode2); 
//arParams[0] = 'array("LID"=>"en"';
//arParams[1] = '"TEXT"=>"text text text"';
//arParams[2] = '"PAYED"=>"N"';
//arParams[3] = '"CANCELED"=>"N")';

</script>