2017 © Pedro Peláez
 

library php-diff

LSM - Longest Common Subsequence

image

ohmybrew/php-diff

LSM - Longest Common Subsequence

  • Thursday, July 6, 2017
  • by ohmybrew
  • Repository
  • 0 Watchers
  • 1 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

PHP Diff

This library simply gets the differences between strings with a few options to output the changes into raw array, xml or text formats., (*1)

Build Status Coverage Status License, (*2)

Installation

The recommended way to install is through composer., (*3)

composer require osiset/php-diff

Usage

setStringOne(
setStringTwo(
execute();

$result = $diff->getResult(); // This outputs a raw array of line, delete and insert operations.

$format = new Text($result);
$format->execute();

header('Content-Type: '.$format->getFormatMime());
print $format->getResult();
```

The output is:

```
one
two
- three
+ threes
+ six
```

Above was the use of the `text` output. You may also output the raw `array` via `$diff->getResult()` or you can ouput in XML format like below:

```php
use Wally\PHPDiff\Format\XML;

...

$result = $diff->getResult();

$format = new XML($result);
$format->execute();

header('Content-Type: '.$format->getFormatMime());
print $format->getResult();
```

The output is:

```xml

<data>
<line>one</line>
<line>two</line>
<delete>three</delete>
<insert>threes</insert>
<insert>six</insert>
</data>

The Versions

06/07 2017

dev-master

9999999-dev

LSM - Longest Common Subsequence

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Tyler King

common longest subsequence lsm

04/09 2012

1.0.0

1.0.0.0

LSM - Longest Common Subsequence

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

common longest subsequence lsm