<?php
require_once('./../xdict.class.php');
echo '<pre>';
highlight_string('<?php
function odd($var)
{
return($var & 1);
}
function even($var)
{
return(!($var & 1));
}
$x=xdict(0,"",false);
$x->fill_with(array("a"=>1, "b"=>2, "c"=>3, "d"=>4, "e"=>5));
$y=xdict(0,"",false);
$y->fill_with(array(6, 7, 8, 9, 10, 11, 12));
echo "odd :\n";
print_r($x->filter("odd"));
echo "Even :\n";
print_r($y->filter("even"));
?>');
function odd($var)
{
return($var & 1);
}
function even($var)
{
return(!($var & 1));
}
$x=xdict(0,"",false);
$x->fill_with(array("a"=>1, "b"=>2, "c"=>3, "d"=>4, "e"=>5));
$y=xdict(0,"",false);
$y->fill_with(array(6, 7, 8, 9, 10, 11, 12));
echo "odd :\n";
print_r($x->filter("odd"));
echo "Even :\n";
print_r($y->filter("even"));
highlight_string('<?php
$w=xdict(0,"",false);
$w->fill_with(array(6, 7, 8,8, 9, 10, 11, 12,12,$u=xdict(),&$u,&$u));
echo "unique :\n";
print_r($w->unique(SORT_STRING));
echo "count values :\n";
print_r($w->count_values());
?>');
$w=xdict(0,"",false);
$w->fill_with(array(6, 7, 8,8, 9, 10, 11, 12,12,$u=xdict(),&$u,&$u));
echo "unique :\n";
print_r($w->unique(SORT_STRING));
echo "count values :\n";
print_r($w->count_values());
?>
|