• Resolved Juan Dómina

    (@juandomina)


    Hi, if you have newer versions of php installed on your server you will notice that plugin doesn′t work. That because “array_column” function was deprecated. You must code your own function for that. The next code is a solution for that problem. Paste it on the top of mail2users.php file (behind first coments):

    if (! function_exists(‘array_column’)) {
    function array_column(array $input, $columnKey, $indexKey = null) {
    $array = array();
    foreach ($input as $value) {
    if ( !array_key_exists($columnKey, $value)) {
    trigger_error(“Key \”$columnKey\” does not exist in array”);
    return false;
    }
    if (is_null($indexKey)) {
    $array[] = $value[$columnKey];
    }
    else {
    if ( !array_key_exists($indexKey, $value)) {
    trigger_error(“Key \”$indexKey\” does not exist in array”);
    return false;
    }
    if ( ! is_scalar($value[$indexKey])) {
    trigger_error(“Key \”$indexKey\” does not contain scalar value”);
    return false;
    }
    $array[$value[$indexKey]] = $value[$columnKey];
    }
    }
    return $array;
    }
    }

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Karam Singh

    (@sony7596)

    Hi I have tested, above code its giving error. Also I have tested its working fine. I will update if any issue raised.

    Thread Starter Juan Dómina

    (@juandomina)

    Oh sorry! If you have older versions of php, you′re a gonna need array_columns, because it was introduced in php 5.5

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Fix for undefined function array_column’ is closed to new replies.