<?php function data() { $out[0] = "abc"; $out[1] = "def"; $out[2] = "ghi"; return $out; } $data = data(); foreach($data as $items){ echo $items; }
// Function to swap two numbers function swap( $x, $y ) { return array( $y, $x ); }