WiseLoop PHP Advanced String Classes is the complete multi-byte and binary safe PHP string processing solution that enables you to:
validate input data types (alpha, numeric, date, IP, email, URL, hex), change case,
apply string effects (shorten, shuffle, scramble, reverse, make URL SEO friendly), generate passwords, generate GUIDs,
process and extract characters, words and sentences, compute statistics (word count, unique word count, char count),
numbers extraction, substring searching and replacing, padding, trimming, splitting, word wrapping, html processing,
encrypting, encoding, censoring, spell checking, spell auto correcting etc.
All the methods and classes have full support for any language character set or alphabet through a customizable configuration class.
<?php
require_once dirname(__FILE__)."/../../php-advanced-string-classes/bin/wlString.php";
$s = new wlString('apl');
echo $s->getClosestMatch();
echo '<pre>' . print_r($s->getMatches(), true) . '</pre>';
echo '<pre>' . print_r($s->getMatches(20), true) . '</pre>';
echo '<br/>';
$s->set('The qiuck fox jmepud oevr the lazy dog.');
echo $s->spellEmphasize() . '<br/>';
echo $s->spellAutoCorrect();
echo '<pre>' . print_r($s->spellCheck(), true) . '</pre>';
Result:
Array ( )
Array ( [0] => Array ( [word] => applique [percent] => 49.06 ) [1] => Array ( [word] => applemubojumbo [percent] => 27.57 ) )
Array ( [The] => The [qiuck] => quick [jmepud] => jumped [oevr] => over [the] => The )
<?php
require_once dirname(__FILE__)."/../../php-advanced-string-classes/bin/wlString.php";
$s = new wlString('applemubojumbo');
echo $s->getClosestMatch('DictionaryCom') . '<br/>';
echo '<br/>';
$s->set('applewqrew');
echo $s->getClosestMatch('DictionaryCom') . '<br/>';
echo '<br/>';
$s->set('The qiuck fox jmepud oevr the lazy dog.');
echo $s->spellEmphasize('DictionaryCom') . '<br/>';
echo $s->spellAutoCorrect('DictionaryCom') . '<br/>';
Result:
<?php
require_once dirname(__FILE__)."/../../php-advanced-string-classes/bin/wlString.php";
$s = new wlString('applemubojumbo');
echo $s->getClosestMatch('AonawareCom') . '<br/>';
echo '<br/>';
$s->set('applewqrew');
echo $s->getClosestMatch('AonawareCom') . '<br/>';
echo '<br/>';
$s->set('The qiuck fox jmepud oevr the lazy dog.');
echo $s->spellEmphasize('AonawareCom') . '<br/>';
echo $s->spellAutoCorrect('AonawareCom') . '<br/>';
Result:
<?php
require_once dirname(__FILE__)."/../../php-advanced-string-classes/bin/wlString.php";
$s = new wlString('apple');
echo $s->soundexPercent('apple') . '% match "apple"<br/>';
echo $s->soundexPercent('aple') . '% match "aple"<br/>';
echo $s->soundexPercent('aplo') . '% match "aplo"<br/>';
echo $s->soundexPercent('epl') . '% match "epl"<br/>';
echo $s->soundexPercent('onion') . '% match "onion"<br/>';
echo $s->soundexPercent('cabbage') . '% match "cabbage"<br/>';
echo $s->soundexPercent('painting') . '% match "painting"<br/>';
Result:
<?php
require_once dirname(__FILE__)."/../../php-advanced-string-classes/bin/wlString.php";
$s = new wlString('apple');
echo $s->levenshtein('apple') . ' operations needed to obtain "apple"<br/>';
echo $s->levenshteinPercent('apple') . '% match "apple"<br/>';
echo '<br/>';
echo $s->levenshtein('aple') . ' operations needed to obtain "aple"<br/>';
echo $s->levenshteinPercent('aple') . '% match "aple"<br/>';
echo '<br/>';
echo $s->levenshtein('aplo') . ' operations needed to obtain "aplo"<br/>';
echo $s->levenshteinPercent('aplo') . '% match "aplo"<br/>';
echo '<br/>';
echo $s->levenshtein('onion') . ' operations needed to obtain "onion"<br/>';
echo $s->levenshteinPercent('onion') . '% match "onion"<br/>';
Result:
<?php
require_once dirname(__FILE__)."/../../php-advanced-string-classes/bin/wlString.php";
$s = new wlString('apple');
echo $s->soundsLike('apple') ? $s->append(' sounds like "apple"') : $s->append(' does not sound like "apple"'); echo '<br/>';
echo $s->soundsLike('aple') ? $s->append(' sounds like "aple"') : $s->append(' does not sound like "aple"'); echo '<br/>';
echo $s->soundsLike('epl') ? $s->append(' sounds like "epl"') : $s->append(' does not sound like "epl"'); echo '<br/>';
echo $s->soundsLike('epl', 70) ? $s->append(' sounds like "epl"') : $s->append(' does not sound like "epl"'); echo '<br/>';
Result:
<?php
require_once dirname(__FILE__)."/../../php-advanced-string-classes/bin/wlString.php";
$s = new wlString('apple');
echo $s->matchPercent('apple') . '% match "apple"<br/>';
echo $s->matchPercent('aple') . '% match "aple"<br/>';
echo $s->matchPercent('aplo') . '% match "aplo"<br/>';
echo $s->matchPercent('epl') . '% match "epl"<br/>';
echo $s->matchPercent('onion') . '% match "onion"<br/>';
echo $s->matchPercent('cabbage') . '% match "cabbage"<br/>';
echo $s->matchPercent('painting', true, true, true, true) . '% match "painting"<br/>';
Result:
<?php
require_once dirname(__FILE__)."/../../php-advanced-string-classes/bin/wlString.php";
$s = new wlString('apple');
echo $s->soundex() . '<br/>';
echo $s->metaphone() . '<br/>';
Result:
<?php
require_once dirname(__FILE__)."/../../php-advanced-string-classes/bin/wlString.php";
$s = new wlString('apple');
echo $s->metaphonePercent('apple') . '% match "apple"<br/>';
echo $s->metaphonePercent('aple') . '% match "aple"<br/>';
echo $s->metaphonePercent('aplo') . '% match "aplo"<br/>';
echo $s->metaphonePercent('epl') . '% match "epl"<br/>';
echo $s->metaphonePercent('onion') . '% match "onion"<br/>';
echo $s->metaphonePercent('cabbage') . '% match "cabbage"<br/>';
echo $s->metaphonePercent('painting') . '% match "painting"<br/>';
Result:
<?php
require_once dirname(__FILE__)."/../../php-advanced-string-classes/bin/wlString.php";
$s = new wlString('apple');
echo $s->intersectionPercent('apple') . '% match "apple"<br/>';
echo $s->intersectionPercent('aple') . '% match "aple"<br/>';
echo $s->intersectionPercent('aplo') . '% match "aplo"<br/>';
echo $s->intersectionPercent('epl') . '% match "epl"<br/>';
echo $s->intersectionPercent('onion') . '% match "onion"<br/>';
echo $s->intersectionPercent('cabbage') . '% match "cabbage"<br/>';
echo $s->intersectionPercent('painting') . '% match "painting"<br/>';
Result: