1<?php
2
3function data() {
4 $out[0] = "abc";
5 $out[1] = "def";
6 $out[2] = "ghi";
7 return $out;
8}
9
10$data = data();
11foreach($data as $items){
12 echo $items;
13}
14
1function myfunc(){
2 $arr = array();
3 $arr[] = 'value0';
4 $arr['key1'] = 'value1';
5 $arr['key2'] = 'value2';
6 $arr[] = 'value3';
7 return $arr;
8}
9