本文整理汇总了PHP中Diff::toHTML方法的典型用法代码示例。如果您正苦于以下问题:PHP Diff::toHTML方法的具体用法?PHP Diff::toHTML怎么用?PHP Diff::toHTML使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Diff
的用法示例。
在下文中一共展示了Diff::toHTML方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run3
public function run3()
{
Qdmvc::loadHelper('class.Diff');
$diff = Diff::compare('Ngay do', 'Ngay mua', true);
echo Diff::toHTML($diff, '');
return;
foreach ($diff as $item) {
if ($item[1] == Diff::DELETED) {
echo $item[0];
}
}
echo '<br>';
foreach ($diff as $item) {
if ($item[1] == Diff::INSERTED) {
echo $item[0];
}
}
?>
<?php
}
示例2: create_file
}
echo "-----------------Diff show me the differ : ------------------\n";
$originalOPTB_WOCFile = ORIGIN_FILE_PATH . $path_parts['filename'] . '-objectcode.txt';
if (file_exists($originalOPTB_WOCFile)) {
$diffOPTB_WOC = Diff::compareFiles($originalOPTB_WOCFile, $OPTB_WOCtxtFile);
echo Diff::toString($diffOPTB_WOC);
create_file(RESULT_PATH . $OUTPUT_LOG_PREFIX . "diff-OPTB_WOC.html", Diff::toHTML($diffOPTB_WOC));
echo "\n";
} else {
echo $originalOPTB_WOCFile . "\n" . 'do not exist' . "\n";
}
$orignalObjectPFile = ORIGIN_FILE_PATH . $path_parts['filename'] . '-objectprogram.txt';
if (file_exists($orignalObjectPFile)) {
$diffObjectP = Diff::compareFiles($orignalObjectPFile, $obectProgramTxtFile);
echo Diff::toString($diffObjectP);
create_file(RESULT_PATH . $OUTPUT_LOG_PREFIX . "diff-ObjectProgram.html", Diff::toHTML($diffObjectP));
echo "\n";
} else {
echo $orignalObjectPFile . "\n" . 'do not exist' . "\n";
}
echo "-------------------------Diff end ----------------------------\n";
compare_array_in_html_js(RESULT_PATH . $OUTPUT_LOG_PREFIX . "compare_html_js.html", $OPTB_WOC, $orignalCode, "Compare Array", false);
}
## end ## print out OPTB
}
}
}
}
}
}
}