PHP code example of wikimedia / equivset

1. Go to this page and download the library: Download wikimedia/equivset library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

wikimedia / equivset example snippets


use Wikimedia\Equivset\Equivset;

$equivset = new Equivset();

// Normalize a string
echo $equivset->normalize( 'sp00f' ); // SPOOF

// Get a single character.
if ( $equivset->has( 'ɑ' ) ) {
	$char = $equivset->get( 'ɑ' );
}
echo $char; // A

// Loop over entire set.
foreach ( $equivset as $char => $equiv ) {
	// Do something.
}

// Get the entire set.
$all = $equivset->all();