PHP code example of fomvasss / laravel-punycode

1. Go to this page and download the library: Download fomvasss/laravel-punycode 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/ */

    

fomvasss / laravel-punycode example snippets


  Fomvasss\Punycode\PunycodeServiceProvider::class,

use Fomvasss\Punycode\Facades\Punycode;

var_dump(Punycode::encode('веб-вест.сайт'));
// outputs: xn----9sbccmd8fi.xn--80aswg;

var_dump(Punycode::decode('xn----9sbccmd8fi.xn--80aswg'));
// outputs: веб-вест.сайт

punycode_encode('веб-вест.сайт');
punycode_decode('xn----9sbccmd8fi.xn--80aswg');
bash
php artisan vendor:publish --provider="Fomvasss\Punycode\PunycodeServiceProvider" --tag="config"