for (i=0; i<=20; ++i) { echo $array[$i] . '<br />'; }
class arrayPuller { /*private*/ var $elementCount; /*private*/ var $arrayTemp = array(); /*private*/ var $message = array('Array is empty','Array element is less then pulled array'); function includeArray($toIncludeArray) { if(!$toIncludeArray) { print $this->message(0); exit(); } $this->arrayTemp = $toIncludeArray; $this->elementCount = count($toIncludeArray); } function echoArray($start,$total) { $toDisplayTotal = $total - $start; if($toDisplayTotal < $this->elementCount) { print $this->message(1); return; } for($i=start; $i<($i+$total); $i++) { if(!is_array($this->arrayTemp[$i])) { echo $this->arrayTemp[$i].'<br />'; } else { echo 'Array()'; } } } }//end of class