title: Convert English Numbers to Persian
body: <p>I am using the following JavaScript to convert all the English numbers showing on my website to Persian.</p>
  
  <p>I realize that there are several ways to go about this and I have looked online and tried a few, however, this script does what I want it to do and it was really easy to implement except I want the phone number and date in my footer to be excluded from the conversion and remain English.</p>
  
  <p>Not sure how I go about this in my PHP/HTML page.</p>
  
  <p>On the second note, when my site is loading for a couple of seconds the numbers appear in English and quickly convert to Persian. Just wondering if there was a way that I could reduce this delay?</p>
  
  <p>Here is my code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>&lt;script language="JavaScript" type="text/javascript"&gt;
  var replaceDigits = function() {
  var map =
  [
  "&amp;\#1776;","&amp;\#1777;","&amp;\#1778;","&amp;\#1779;","&amp;\#1780;",
  "&amp;\#1781;","&amp;\#1782;","&amp;\#1783;","&amp;\#1784;","&amp;\#1785;"
  ]
  document.body.innerHTML =
  document.body.innerHTML.replace(
  /\d(?=[^&lt;&gt;]*(&lt;|$))/g,
  function($0) { return map[$0] }
  );
  }
  &lt;/script&gt;
  
  &lt;script type="text/javascript"&gt;
  window.onload = replaceDigits
  &lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>