Answers for "html if en change to ltr"

1

html if en change to ltr

<?php
$language = str_replace('_', '-', app()->getLocale());
if ($language == 'ar') {
    $dir = 'rtl';
} else {
    $dir = 'ltr';
}
?>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}" dir="<?php echo $dir; ?>">

</html>
Posted by: Guest on June-02-2021

Browse Popular Code Answers by Language