Change an associative array into an indexed array / get an Zend_Table_Row_Abstract as non-associative

后端 未结 4 1386
无人及你
无人及你 2021-02-03 17:19

Hi out there in Stackland. I was wondering if there was either a function or an easy way to change an associative array into an indexed array.

To elaborate, I\'m using

4条回答
  •  北海茫月
    2021-02-03 17:33

    You could use this simple piece of code, if you do not want to use the inbuilt PHP function.

    $input_array;           // This is your input array
    $output_array = [];     // This is where your output will be stored.
    foreach ($input_array as $k => $v){
        array_push($output_array, $v);
    }
    print_r($output_array);
    

提交回复
热议问题