本文整理匯總了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
}
}
}
}
}
}
}