- array_merge: documentation ( source)
- implode: documentation ( source)
- strtoupper: documentation ( source)
- range: documentation ( source)
<?php
class testCase {
private $stores;
public function doFunction($items = array(), $out ) {
foreach($items as $num => $val) {
if($num%2 == 0) {
$out = $val;
} else {
$out = strtoupper($val);
}
$out = "<br />";
}
return $this->store = $out;
}
/* PRIVATE, SO NOT ACCESSIBLE! */
private function unFunction($items = '', $out = array()) {
$items = implode("<br >", $items, -1);
foreach($items as $num => $val) {
if($num%2 != 0) {
$out[$num] = $val;
} else {
$out[$num] = strtlower($val);
}
}
echo $out;
}
}
$test = new testCase();
//echo $test -> doFunction(array_merge(range(0,25), range('a','z'))) . "<hr />";
//print_r($test -> unFunction($test->store));
echo $test->doFunction(array_merge(range(0,25)));
?>