title: Similar text without loss of text formatting
body: <h2>Brief</h2>
  
  <p>How I can similar text using function <strong>similar_text()</strong> without loss of text formatting? I want create one function for similar text without loss text formatting in <strong>case insensitive</strong> regex. I have not been able to do anything myself yet. Because I do not understand such operations similar to the case of text and similar text. I tried only with breaking up words by a space using the function of an <strong>explode()</strong>. And my option does not work in any register. Plus, do not return the original format and the original word register in the text. What should I do? What do you prefer to do on this task? How to get around this situation? Of course, the function should also work very quickly, with as much data as possible (<strong>large array</strong>). As correct words, there will initially be one array with the correct variants of words (in the <strong>lower case</strong>). And using these words from the array, you need to correct the text as correctly as possible and in the source register of the word in the text.</p>
  
  <h1>Example:</h1>
  
  <pre><code>$dict = array(
      "two",
      "occasions",
      "have",
      "been",
      "asked",
      "members",
      "parliament",
      "pray",
      "babbage",
      "you",
      "into",
      "machine",
      "wrong",
      "figures",
      "will",
      "right",
      "answers",
      "come",
      "able",
      "rightly",
      "apprehend",
      "confusion",
      "ideas",
      "question"
  );
  </code></pre>
  
  <h3>Input text:</h3>
  
  <pre>
  On tw ocasons I hve bee aked [by mebers of Pariamnt]: 'Pry, Mr. Babage, if you put ito the mahine wrng figres, wll the rigt aswers cme out?' I am not ale rghty to aprehend the kind of conusion of idas that could provoke such a quetion. Charles Babbage
  </pre>
  
  <h3>Needed result:</h3>
  
  <pre>
  On two occasions I have been asked [by members of Parliament]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question. Charles Babbage
  </pre>