logo
down
shadow

Show English characters instead of Arabic - WordPress


Show English characters instead of Arabic - WordPress

Content Index :

Show English characters instead of Arabic - WordPress
Tag : php , By : WellBeing
Date : November 26 2020, 12:01 PM

I wish this help you I am posting Hadiths in my website and i post it in 3 translations: Arabic, Urdu, English. In Hadith's page, where Hadiths are showing one by one, It's showing Arabic excerpt text. , Try to replace
<?php the_excerpt(); ?>
<?php
$position = strpos(get_the_content(), 'Hadith in English Translation');
$excerpt = strip_tags(substr(get_the_content(), $position));
echo $excerpt;
?>

Comments
No Comments Right Now !

Boards Message :
You Must Login Or Sign Up to Add Your Comments .

Share : facebook icon twitter icon

How do I get both arabic and english text to show in a wordpress blog post?


Tag : wordpress , By : kgw
Date : March 29 2020, 07:55 AM
This might help you Looks like a database charset problem. Here are a few things you can try:
Easiest
 define('DB_CHARSET', 'utf8');
 define('DB_CHARSET', '');

Transliterate arabic characters into english - Wordpress


Tag : php , By : Webtoad
Date : March 29 2020, 07:55 AM
this one helps. you are using str_split fro spliting the arabic multi byte charactors. you need to use a multibyte function.
eg:
function multibyte_str_split($string) {
    $strlen = mb_strlen($string);
    while ($strlen) {
        $array[] = mb_substr($string, 0, 1, "UTF-8");
        $string = mb_substr($string, 1, $strlen, "UTF-8");
        $strlen = mb_strlen($string);
    }
    return $array;
}


$arb = <<<EOD
            <>][/:"~}{,.ذضصثقفغعهخحجدشسيبلاتنمكطئءؤرىةوزظًٌَُّإ÷×؛ٍِأـ،ْآ’؟
EOD;

$ar = multibye_str_split($arb);
function arb2en_title($post=0)
{
  $text = get_the_title($post);


$arb_en_map=array ( 
'\\xd8\\xa1' => '\'', '\\xd8\\xa2' => '|', '\\xd8\\xa3' => '>',
'\\xd8\\xa4' => '&', '\\xd8\\xa5' => '<', '\\xd8\\xa6' => '}',
'\\xd8\\xa7' => 'A', '\\xd8\\xa8' => 'b', '\\xd8\\xa9' => 'p',
'\\xd8\\xaa' => 't', '\\xd8\\xab' => 'v', '\\xd8\\xac' => 'j',
'\\xd8\\xad' => 'H', '\\xd8\\xae' => 'x', '\\xd8\\xaf' => 'd',
'\\xd8\\xb0' => '*', '\\xd8\\xb1' => 'r', '\\xd8\\xb2' => 'z',
'\\xd8\\xb3' => 's', '\\xd8\\xb4' => '$', '\\xd8\\xb5' => 'S',
'\\xd8\\xb6' => 'D', '\\xd8\\xb7' => 'T', '\\xd8\\xb8' => 'Z',
'\\xd8\\xb9' => 'E', '\\xd8\\xba' => 'g', '\\xd9\\x80' => '_',
'\\xd9\\x81' => 'f', '\\xd9\\x82' => 'q', '\\xd9\\x83' => 'k',
'\\xd9\\x84' => 'l', '\\xd9\\x85' => 'm', '\\xd9\\x86' => 'n',
'\\xd9\\x87' => 'h', '\\xd9\\x88' => 'w', '\\xd9\\x89' => 'Y',
'\\xd9\\x8a' => 'y', '\\xd9\\x8b' => 'F', '\\xd9\\x8c' => 'N',
'\\xd9\\x8d' => 'K', '\\xd9\\x8e' => 'a', '\\xd9\\x8f' => 'u',
'\\xd9\\x90' => 'i', '\\xd9\\x91' => '~', '\\xd9\\x92' => 'o',
'\\xd9\\xb0' => '`', '\\xd9\\xb1' => '{', 
        );

foreach($arb_en_map as $key=>$value)
{
    $text=preg_replace("/$key/",$value,$text);
}
return  htmlentities($text);

}
echo arb2en_title();
$arb_en_map=array(
            'د'=>']',
           'ج'=>'[',
           'ح'=>'p',
           'خ'=>'o',
           'ه'=>'i',
           'ع'=>'u',
           'غ'=>'y',
           'ف'=>'t',
           'ق'=>'r',
           'ث'=>'e',
           'ص'=>'w',
           'ض'=>'q',
           'ش'=>'a',
           'س'=>'s',
           'ي'=>'d',
           'ب'=>'f',
           'ل'=>'g',
           'ا'=>'h',
           'ت'=>'j',
           'ن'=>'k',
           'م'=>'l',
           'ك'=>';',
           'ط'=>'\'',
           'ظ'=>'/',
           'ز'=>'.',
           'و'=>',',
           'ة'=>'m',
           'ى'=>'n',
           'ل'=>'b',
           'ر'=>'v',
           'ؤ'=>'c',
           'ء'=>'x',
           'ئ'=>'z',
           'إ'=>'Y',
           'لإ'=>'T',
           'لأ'=>'G',
           'أ'=>'H',
           'لآ'=>'B',
           'آ'=>'N'
);
$arb_en_map=array ( 
 '\\xd8\\xaf' => ']', '\\xd8\\xac' => '[', '\\xd8\\xad' => 'p',
 '\\xd8\\xae' => 'o', '\\xd9\\x87' => 'i', '\\xd8\\xb9' => 'u',
 '\\xd8\\xba' => 'y', '\\xd9\\x81' => 't', '\\xd9\\x82' => 'r',
 '\\xd8\\xab' => 'e', '\\xd8\\xb5' => 'w', '\\xd8\\xb6' => 'q',
 '\\xd8\\xb4' => 'a', '\\xd8\\xb3' => 's', '\\xd9\\x8a' => 'd',
 '\\xd8\\xa8' => 'f', '\\xd9\\x84' => 'B', '\\xd8\\xa7' => 'h',
 '\\xd8\\xaa' => 'j', '\\xd9\\x86' => 'k', '\\xd9\\x85' => 'l',
 '\\xd9\\x83' => ';', '\\xd8\\xb7' => '\'', '\\xd8\\xb8' => '/',
 '\\xd8\\xb2' => '.', '\\xd9\\x88' => ',', '\\xd8\\xa9' => 'm', 
 '\\xd9\\x89' => 'n', '\\xd8\\xb1' => 'v', '\\xd8\\xa4' => 'c', 
 '\\xd8\\xa1' => 'x', '\\xd8\\xa6' => 'z', '\\xd8\\xa5' => 'Y',
 '\\xd8\\xa3' => 'H', '\\xd8\\xa2' => 'N',
 );

English to Arabic conversion in wordpress


Tag : php , By : Webtoad
Date : March 29 2020, 07:55 AM
will help you I want to translate English to Arabic in wordpress (buddy press). , In php we should call like this
$reason    = sprintf(__("Wave limit has been exceeded for today, you can wave  tomorrow %s","buddypress"),$user);

php separate arabic from english characters


Tag : php , By : Nathan Good
Date : March 29 2020, 07:55 AM
will be helpful for those in need in this question : php separate chinese from english characters separate chinese from english, but not work for arabic characters and not separated, how change that code to work for arabic characters ? , For your case you can use like,
$arabic = preg_replace(array('/[\x{0600}-\x{06FF}?]/u', '/(\s)+/'), array('', '$1'), $str);
^[\u0621-\u064A\u0660-\u0669 ]+$

How can I extract English characters from a string of mixed (Arabic and English) Letters


Tag : python , By : Ed.
Date : January 02 2021, 06:48 AM
may help you . I have many strings similar as below , Using Regex.
Ex:
import re
s = """A ali - عالي
Baghdad - بغداد"""

for line in s.splitlines():
    m = re.search(r"([A-Za-z\s]+)", line)
    if m:
        print(m.group(1))
A ali 
Baghdad 
Related Posts Related QUESTIONS :
  • How to iterate array inside array data in laravel ,output are given below
  • To get output of movie with its genre
  • Extracting some data from a JS object literal string in PHP using Regex
  • axios and vuex are deleting wrong index in array
  • Setting empty CURLOPT_POSTFIELDS
  • Laravel 5.8 use subdomain as API endpoint beside domain.com/api
  • Error while add data in database SQL Server 2016
  • Does PhpStorm allow to skip PHPDoc tags when type hints is declared?
  • html classes are changed to Attributes
  • Using json to import multidimensional data
  • passing data from the view to the controller, where the data comes from another controller
  • How to extract integer and decimal numbers in PHP string correctly?
  • Parsing Sub-Object from an XML Feed with objects
  • Getting error "Unknown column 'text' in 'field list'"
  • How to properly get onedrive access token via php and curl
  • How to add spell check to a php function
  • Is it posible to create css rules with php?
  • Pretty URL with $_GET method
  • Wordpress always load same page - index.php
  • Find value in array and return with new from different array
  • PHP multiple file upload with different keys
  • Can't modify times one a time without weird errors
  • Get size of scraped image with domcrawler (Goutte)
  • Laravel - Ordering a collection of models
  • PHP Fatal error: Uncaught Error: Call to a member function setFetchMode() on boolean
  • Strict Standards: Only variables should be passed by reference in /main_dir/sub_dir/backup.php
  • Uncaught Google_Exception: (update) unknown parameter: 'copyRequiresWriterPermission'
  • Laravel 5 form does not redirect with old input
  • How to get values greater than or equal to in Mysql database sql when its a value like 1:00 PM?
  • PHP datediff overday issue
  • Masking an auto incrementing primary key
  • How to grab a String BEFORE a certain word
  • ZF2 Routing Multiple Controllers based on route constraints
  • How to deregister/dequeue jquery.sticky.js in Elementor (Pro)?
  • How to fix errors counting words in text plain with PHP?
  • How to get View data in Laravel in custom helper or directive
  • Creating a new data entry into a database with eloquent and trying to access the variable in the url
  • How to test authentication using Laravel Dusk?
  • PHP parse_str not getting all $_GET variables
  • Variable issues in php class
  • Get orders between dates in Codeigniter
  • Eloquent Special Chars Issue
  • Keeping leading zeros column Mysql
  • Current level navigation in Wordpress
  • Add a custom text to WooCommerce cart items if the product has a specific shipping class
  • Error connecting to CommissionJunction Token : [60] SSL certificate problem: unable to get local issuer certificate
  • How do I add a new key value pair to an object in PHP?
  • Http post request to php with dart
  • How to add a route in with blade into parameters of a component
  • How can i get the source of a 777 - CHMOD php file?
  • Convert 2010-04-16 16:30:00 to "Tomorrow Afternoon"
  • How can I hide a $_GET variable to be more secured in PHP?
  • Login to Gmail Inbox using Curl?
  • Upload Excel or CSV file to MySQL with PHP
  • Outlook Marking Email as Junk Email
  • Upload an image using class.upload.php via AJAX, display image in form using jQuery
  • mysql_connect() causes page to not display (WAMP)
  • How to limit a users uploaded image size using PHP
  • What's the difference whether or not to run PHP in safe mode?
  • Logging in to a website cURL
  • shadow
    Privacy Policy - Terms - Contact Us © scrbit.com