original_string: public function compare($old, $new, $mode = 'normal')
  	{
  		// Mixed
  		if ( $mode === 'mixed')
  		{
  			// Insert characters
  			$ins_begin 	= '<ins>+ ';
  			$ins_end 	= '</ins>' . PHP_EOL;
  
  			// Delete characters
  			$del_begin 		= '<del>- ';
  			$del_end		= '</del>' . PHP_EOL;
  		}
  		// HTML mode
  		elseif ( $mode === 'html' )
  		{
  			// Insert characters
  			$ins_begin 	= '<ins>';
  			$ins_end 	= '</ins>' . PHP_EOL;
  
  			// Delete characters
  			$del_begin 		= '<del>';
  			$del_end		= '</del>' . PHP_EOL;
  		}
  		// Normal mode
  		else
  		{
  			// Insert characters
  			$ins_begin 	= '+ ';
  			$ins_end 	= PHP_EOL;
  
  			// Delete characters
  			$del_begin 		= '- ';
  			$del_end		= PHP_EOL;
  		}
  
  		// Turn the strings into an array so it's a bit easier to parse them
  		$diff	= $this->diff(explode(PHP_EOL, $old), explode(PHP_EOL, $new));
  		$result	= '';
        
        if ($mode == 'raw')
           return $diff;
  
  		foreach($diff as $line)
  		{
  			if(is_array($line))
  			{
  				$result .= !empty($line['del']) ? $del_begin . implode(PHP_EOL, $line['del']) . $del_end : '';
  				$result .= !empty($line['ins']) ? $ins_begin . implode(PHP_EOL, $line['ins']) . $ins_end : '';
  			}
  			else
  			{
  				$result .= $line . PHP_EOL;
  			}
  		}
  
  		// Return the result
  		return $result;
  	}
code: public function compare($old, $new, $mode = 'normal')
  	{
  		// Mixed
  		if ( $mode === 'mixed')
  		{
  			// Insert characters
  			$ins_begin 	= '<ins>+ ';
  			$ins_end 	= '</ins>' . PHP_EOL;
  
  			// Delete characters
  			$del_begin 		= '<del>- ';
  			$del_end		= '</del>' . PHP_EOL;
  		}
  		// HTML mode
  		elseif ( $mode === 'html' )
  		{
  			// Insert characters
  			$ins_begin 	= '<ins>';
  			$ins_end 	= '</ins>' . PHP_EOL;
  
  			// Delete characters
  			$del_begin 		= '<del>';
  			$del_end		= '</del>' . PHP_EOL;
  		}
  		// Normal mode
  		else
  		{
  			// Insert characters
  			$ins_begin 	= '+ ';
  			$ins_end 	= PHP_EOL;
  
  			// Delete characters
  			$del_begin 		= '- ';
  			$del_end		= PHP_EOL;
  		}
  
  		// Turn the strings into an array so it's a bit easier to parse them
  		$diff	= $this->diff(explode(PHP_EOL, $old), explode(PHP_EOL, $new));
  		$result	= '';
        
        if ($mode == 'raw')
           return $diff;
  
  		foreach($diff as $line)
  		{
  			if(is_array($line))
  			{
  				$result .= !empty($line['del']) ? $del_begin . implode(PHP_EOL, $line['del']) . $del_end : '';
  				$result .= !empty($line['ins']) ? $ins_begin . implode(PHP_EOL, $line['ins']) . $ins_end : '';
  			}
  			else
  			{
  				$result .= $line . PHP_EOL;
  			}
  		}
  
  		// Return the result
  		return $result;
  	}
code_tokens: public function compare ( $ old , $ new , $ mode = 'normal' ) { // Mixed if ( $ mode === 'mixed' ) { // Insert characters $ ins_begin = '<ins>+ ' ; $ ins_end = '</ins>' . PHP_EOL ; // Delete characters $ del_begin = '<del>- ' ; $ del_end = '</del>' . PHP_EOL ; } // HTML mode elseif ( $ mode === 'html' ) { // Insert characters $ ins_begin = '<ins>' ; $ ins_end = '</ins>' . PHP_EOL ; // Delete characters $ del_begin = '<del>' ; $ del_end = '</del>' . PHP_EOL ; } // Normal mode else { // Insert characters $ ins_begin = '+ ' ; $ ins_end = PHP_EOL ; // Delete characters $ del_begin = '- ' ; $ del_end = PHP_EOL ; } // Turn the strings into an array so it's a bit easier to parse them $ diff = $ this -> diff ( explode ( PHP_EOL , $ old ) , explode ( PHP_EOL , $ new ) ) ; $ result = '' ; if ( $ mode == 'raw' ) return $ diff ; foreach ( $ diff as $ line ) { if ( is_array ( $ line ) ) { $ result .= ! empty ( $ line [ 'del' ] ) ? $ del_begin . implode ( PHP_EOL , $ line [ 'del' ] ) . $ del_end : '' ; $ result .= ! empty ( $ line [ 'ins' ] ) ? $ ins_begin . implode ( PHP_EOL , $ line [ 'ins' ] ) . $ ins_end : '' ; } else { $ result .= $ line . PHP_EOL ; } } // Return the result return $ result ; }
docstring: Compare two strings and return the difference
  
  @access public
  @param string $old The first block of data
  @param string $new The second block of data
  @param string $mode The mode to use. Possible values are normal, html and mixed
  @return string
docstring_tokens: Compare two strings and return the difference