PHP Classes

File: examples/CombineAndMerge.php

Recommend this page to a friend!
  Classes of zinsou A.A.E.Mo´se   PHP Dictionary to Array class   examples/CombineAndMerge.php   Download  
File: examples/CombineAndMerge.php
Role: Example script
Content type: text/plain
Description: example script
Class: PHP Dictionary to Array class
Manipulate value collections as arrays or objects
Author: By
Last change:
Date: 5 years ago
Size: 1,991 bytes
 

Contents

Class file image Download
<?php
require_once('./../xdict.class.php');
echo
'<pre>';\
highlight_string('<?php
$x=xdict(0,"",false);
$x->fill_with(array("a"=>"green", "b"=>"red", "c"=>"yellow"));
$y=xdict(0,"",false);
$y->fill_with(array("d"=>"avocado", "e"=>"apple", "f"=>"banana"));
$c=$x->combine($y);
$d=$x->rcombine($y);
$e=$y->combine($x);
$f=$y->rcombine($x);
print_r($c);
print_r($d);
print_r($e);
print_r($f);
$b=$a->rcombine($x);
print_r($b);
$b=$a->combine($x);
print_r($b);
$y=xdict(0,"",false);
$y->fill_with(array("d"=>"avocado", "e"=>"apple", "f"=>"banana","i"=>"orange","j"=>"pineaple"));
$b=$a->rcombine($y);
print_r($b);
$b=$a->combine($y);
print_r($b);
?>'
);
$x=xdict(0,"",false);
$x->fill_with(array("a"=>"green", "b"=>"red", "c"=>"yellow"));
$y=xdict(0,"",false);
$y->fill_with(array("d"=>"avocado", "e"=>"apple", "f"=>"banana"));
$c =$x->combine($y);
$d=$x->rcombine($y);
$e =$y->combine($x);
$f=$y->rcombine($x);
$a=xdict(0,"",false);
$a->fill_with(array("d"=>"avocado", "e"=>"apple", "f"=>"banana","i"=>xdict(0,'k',true,true,4)));


print_r($c);
print_r($d);
print_r($e);
print_r($f);
$b=$a->rcombine($x);
print_r($b);
$b=$a->combine($x);
print_r($b);
$y=xdict(0,"",false);
$y->fill_with(array("d"=>"avocado", "e"=>"apple", "f"=>"banana","i"=>"orange","j"=>"pineaple"));
$b=$a->rcombine($y);
print_r($b);
$b=$a->combine($y);
print_r($b);
highlight_string('<?php
$g =$x->merge($y);
$h =$y->merge($x);

print_r($g);
print_r($h);
$i=xdict(0,"",false);
$i->fill_with(array("color" => array("favorite" => "red"), 5));
$ar2 = array(10, "color" => array("favorite" => "green", "blue"));
$result = $i->merge_recursive($ar2);
print_r($result);

?>'
);
$g =$x->merge($y);
$h =$y->merge($x);

print_r($g);
print_r($h);
$i=xdict(0,"",false);
$i->fill_with(array("color" => array("favorite" => "red"), 5));
$ar2 = array(10, "color" => array("favorite" => "green", "blue"));
$result = $i->merge_recursive($ar2);
print_r($result);
?>