Home > PHP > Function > xdiff > xdiff_string_diff()

xdiff_string_diff()

xdiff_string_diff - Make unified diff of two strings

Syntax

string xdiff_string_diff ()

Arguments

-

Description

Makes an unified diff containing differences between old_data string and new_data string and returns it. The resulting diff is human-readable. An optional context parameter specifies how many lines of context should be added around each change. Setting minimal parameter to true will result in outputting the shortest patch file possible (can take a long time).

Version

PHP PECL xdiff >= 0.2.0

Return value

Returns string with resulting diff or FALSE if an internal error happened.