将多维关联数组插入关联数组中

时间:2016-05-25 13:59:56

标签: php arrays

我有以下数组:

Array ( [0] => Array ( [0] => 19132 [1] => 19133 [2] => 19134 ) )

我想插入以下函数来创建一个关联数组:

public function userPersmissions($summary, $dbName, $userId, $arisUserGroup, $arisFolderPath)
{
    $json = Array ( "fields" => Array (
        "project" => Array
        ( "id" => 19806 ),
        "summary" => $summary,
        "issuetype" => Array ( "name" => "User Permissions" ),

        "customfield_14922" =>Array (
            "id" => $dbName
        ),
        "customfield_14447" =>$userId,

        "customfield_14923" =>Array (
            "id" => $arisUserGroup
        ),

        "customfield_15579" =>$arisFolderPath

    )
    );

    return $json;
}

数组通过变量$arisUserGroup

传递给函数

但我得到一个错误,说$ arisUserGroup不是数组,而我打印出来并确定它是一个数组。

我用这种方式调用函数:

try{
    //Capture

    $userGroup[] = Input::get('arisUserGroup');

    $process = $collector->userPersmissions(
        escape(Input::get('summary')),
        escape(Input::get('dbName')),
        escape(Input::get('acnumber')),
        escape($userGroup),
        escape(Input::get('arisFolderPath'))

    );

    $_SESSION['test'] = $collector->processArray($process);



}catch (Exception $e){
    die($e->getMessage());
}

请协助

0 个答案:

没有答案