Search code examples
javascriptphpalertpersianfarsi

PHP alert message in persian language


I have a delete page, I am trying to get an alert message to popup If the delete operation was performed, Display. I want to show text message in alert box in Persian (Farsi) language, but This code is done but Persian characters do not display correctly. please help me What should I do?

 echo '<script>';
 echo 'alert("حذف");';
 echo 'location.href="Delete Touristplace1.php"';
 echo '</script>';

Solution

  • I found my answer:

    Set UTF-8 as the character set for all headers output by your PHP code

    In every PHP output header, specify UTF-8 as the encoding:
    
      header('Content-Type: text/html; charset=utf-8');