本文整理匯總了PHP中Diff::prettyHtml方法的典型用法代碼示例。如果您正苦於以下問題:PHP Diff::prettyHtml方法的具體用法?PHP Diff::prettyHtml怎麽用?PHP Diff::prettyHtml使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Diff
的用法示例。
在下文中一共展示了Diff::prettyHtml方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: diff_prettyHtml
/**
* Convert a diff array into a pretty HTML report.
*
* @param array $diffs Array of diff arrays.
*
* @return string HTML representation.
*/
public function diff_prettyHtml($diffs)
{
$this->diff->setChanges($diffs);
return $this->diff->prettyHtml();
}
示例2: testPrettyHtml
public function testPrettyHtml()
{
// Pretty print.
$this->d->setChanges(array(array(Diff::EQUAL, "a\n"), array(Diff::DELETE, "<B>b</B>"), array(Diff::INSERT, "c&d")));
$this->assertEquals('<span>a¶<br></span><del style="background:#ffe6e6;"><B>b</B></del><ins style="background:#e6ffe6;">c&d</ins>', $this->d->prettyHtml());
}