Skip to content

Commit

Permalink
0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
lukascivil committed May 1, 2016
1 parent 30af89b commit 4edca23
Show file tree
Hide file tree
Showing 2 changed files with 177 additions and 164 deletions.
39 changes: 14 additions & 25 deletions example/index.php
Original file line number Diff line number Diff line change
@@ -1,27 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>treeWalker</title>
</head>
<body>
<?php
include "../src/treeWalker.php";

$treeWalker = new treeWalker(array(
<?php
include "../src/treeWalker.php";
$treeWalker = new treeWalker(array(
"debug"=>true, //true => return the time, false => not
"returntype"=>"jsonstring") //Returntype = ["obj","jsonstring","array"]
);

/*$struct2 = json_decode(utf8_encode(file_get_contents('json/json1.json')), true);
$struct1 = json_decode(utf8_encode(file_get_contents('json/json2.json')), true);*/

$struct1 = array("casa"=>1, "b"=>"5", "cafeina"=>array("ss"=>"ddd"), "oi"=>5);
$struct2 = array("casa"=>2, "cafeina"=>array("ss"=>"dddd"), "oi2"=>5);

//first argument == modified, second argument static
//print_r($treeWalker->getdiff($struct1, $struct2));
print_r($treeWalker->replaceValues($struct2, "test", "ss", false));
?>
</body>
</html>
);
/*$struct2 = json_decode(utf8_encode(file_get_contents('json/json1.json')), true);
$struct1 = json_decode(utf8_encode(file_get_contents('json/json2.json')), true);*/
$struct1 = array("casa"=>1, "b"=>"5", "cafeina"=>array("ss"=>"ddd"), "oi"=>5, "1" => "255");
//$struct2 = array("casa"=>2, "cafeina"=>array("ss"=>"dddd"), "oi2"=>5);
//first argument == modified, second argument static
//print_r($treeWalker->getdiff($struct1, $struct2));
//print_r($treeWalker->replaceValues($struct2, "test", "ss", false));
$treeWalker->createDynamicallyObjects($struct1, array(1,2,5,9,10,11));
print_r($struct1);
?>
Loading

0 comments on commit 4edca23

Please sign in to comment.