how i can solve this question related in levenshtein distance php

how to solve this question using php:
Given two strings input of printable text, a and b .
let the edit distance between a and b is least number of operations needed to transform a to
b, write php code that calculate edit distance using:

hamming distance that only have substitute operations (ex. substitute letter X with
letter Y), pad shorter text with spaces.
Levenshtein distance: that have 3 possible operators: insert, delete or substitution
operations
the function should consider all possibilities but should not consider the same part twice, and
report the smallest possible distance
hamming_dis(a, b) returns integer
levenshtein_dis(a, b) returns integer
Your code should use the following:
OOP
two classes one for each mode hamming or levenshtein
one public static helper that creates an instance, initialise the state, do the
calculation and return the result
define protected/private properties as needed to hold input strings and
intermediate data that you use
private/protected methods that you call recursively if needed
those methods should take offset from the beginning of input texts instead of
passing substrings
document/comment your code
write another file that requires your file as a library and perform some tests on it
write another command line tool that prompt for two input strings and display the
levenshtein distance
write a web page with a form of two fields and returns the levenshteindistance,
provide instructions to run it using PHP's builtin web server from command line
example levenshtein distances
a: "this is a test"
b: "this is test"
levenshtein: 2 operations (remove a and next space)
a: "this is test"
b: "the is test"
levenshtein: 2 operations (replace i with e in this and remove s
Comments (0)