<?php $list = array("A","B","C","D"); foreach ( $list as $var ) { print(item($list)); } function item($list) { return current($list); } ?>