src/Utilities/Arrays.php
public static function values2string(array $array, $arrayColumnKey = '', $separator = ',')
    {
        /*
         * No elements?
         * Nothing to do
         */
        if (empty($array)) {
            return null;
        }

        $values = [];

        foreach ($array as $key => $value) {
            $appendMe = null;

            if (is_array($value)) {
                $appendMe = self::values2string($value, $arrayColumnKey, $separator);
            } elseif (empty($arrayColumnKey)) {
                $appendMe = $value;
            } elseif ($key === $arrayColumnKey) {
                $appendMe = $array[$arrayColumnKey];
            }

            /*
             * Part to append is unknown?
             * Let's go to next part
             */
            if (null === $appendMe) {
                continue;
            }

            $values[] = $appendMe;
        }

        /*
         * No values found?
         * Nothing to do
         */
        if (empty($values)) {
            return null;
        }

        return implode($separator, $values);
    }
public static function values2string(array $array, $arrayColumnKey = '', $separator = ',')
    {
        /*
         * No elements?
         * Nothing to do
         */
        if (empty($array)) {
            return null;
        }

        $values = [];

        foreach ($array as $key => $value) {
            $appendMe = null;

            if (is_array($value)) {
                $appendMe = self::values2string($value, $arrayColumnKey, $separator);
            } elseif (empty($arrayColumnKey)) {
                $appendMe = $value;
            } elseif ($key === $arrayColumnKey) {
                $appendMe = $array[$arrayColumnKey];
            }

            /*
             * Part to append is unknown?
             * Let's go to next part
             */
            if (null === $appendMe) {
                continue;
            }

            $values[] = $appendMe;
        }

        /*
         * No values found?
         * Nothing to do
         */
        if (empty($values)) {
            return null;
        }

        return implode($separator, $values);
    }
public static function values2string ( array $ array , $ arrayColumnKey = '' , $ separator = ',' ) { /*
         * No elements?
         * Nothing to do
         */ if ( empty ( $ array ) ) { return null ; } $ values = [ ] ; foreach ( $ array as $ key => $ value ) { $ appendMe = null ; if ( is_array ( $ value ) ) { $ appendMe = self :: values2string ( $ value , $ arrayColumnKey , $ separator ) ; } elseif ( empty ( $ arrayColumnKey ) ) { $ appendMe = $ value ; } elseif ( $ key === $ arrayColumnKey ) { $ appendMe = $ array [ $ arrayColumnKey ] ; } /*
             * Part to append is unknown?
             * Let's go to next part
             */ if ( null === $ appendMe ) { continue ; } $ values [ ] = $ appendMe ; } /*
         * No values found?
         * Nothing to do
         */ if ( empty ( $ values ) ) { return null ; } return implode ( $ separator , $ values ) ; }
Converts given array's column to string.
Recursive call is made for multi-dimensional arrays.

@param array      $array          Data to be converted
@param int|string $arrayColumnKey (optional) Column name. Default: "".
@param string     $separator      (optional) Separator used between values. Default: ",".
@return null|string
Converts given array s column to string . Recursive call is made for multi - dimensional arrays .