0

It looks like the craftcms 2 ArrayHelper created indexed array on large strings. But I'll need a none indexed array. Any ideas what I'll do wrong? Running on php 7.1.

$playerIds = ArrayHelper::stringToArray(craft()->myFlowPlugin->parseString($triggeredFlow->settings['playerIds'], $attributes));
$playerIds = array_unique($playerIds);
$notification->playerIds = $playerIds;

Incorrect with large strings

"include_player_ids":{
    "0":"17cdd77a-0864-4886-94d9-d47faf487848",
    "1":"645daf21-6829-4eg5-ba1b-d07dbe642dab",
.....
}

Correct

"include_player_ids":[
    "4a0d5945-f996-5561-b5f3-a1c95012a9db",
    "d3dba787-2cde-489b-bef3-96df5db46261",
    "993d15ea-2f18-4d88-9de0-35b0e4be1b14",
.....
]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.