Codex

Function Reference/wp text diff

Contents

Description

Displays a human readable HTML representation of the difference between two strings.

The Diff is available for getting the changes between versions. The output is HTML, so the primary use is for displaying the changes. If the two strings are equivalent, then an empty string will be returned. The arguments supported and can be changed are listed below. 'title' : Default is an empty string. Titles the diff in a manner compatible with the output. 'title_left' : Default is an empty string. Change the HTML to the left of the title. 'title_right' : Default is an empty string. Change the HTML to the right of the title. @uses Text_Diff @uses WP_Text_Diff_Renderer_Table

Parameters

$left_string
(string) (required) "old" (left) version of string
Default: None
$right_string
(string) (required) "new" (right) version of string
Default: None
$args
(string) (Optional. Change 'title', 'title_left', and 'title_right' defaults.) array
Default: optional

Return Values

(string) 
Empty string if strings are equivalent or HTML with differences.

Change Log

Since: 2.6

Source File

wp_text_diff() is located in wp-includes/pluggable.php