PHP code example of imsoft-dev / devanagari-reshaper

1. Go to this page and download the library: Download imsoft-dev/devanagari-reshaper 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/ */

    

imsoft-dev / devanagari-reshaper example snippets


use Devanagari\Reshaper\DevanagariReshaper;

$reshaped = DevanagariReshaper::reshapeText('किताब');

$html = '<p>किसान</p><span class="nav-link">विकास</span>';
$out  = DevanagariReshaper::reshapeHtml($html);
// Tag attributes are never modified — only text node content is reshaped

$rows = DevanagariReshaper::reshapeArray(['किसान', 'विकास', 'Hello']);

if (DevanagariReshaper::needsReshaping($text)) {
    $text = DevanagariReshaper::reshapeText($text);
}