title: PHP preg_replace expression for following requirement?
body: <p>Input text:</p>
  
  <pre><code> Hello, raj's            dogs age                              is 18. "
  </code></pre>
  
  <p>Output: </p>
  
  <pre><code>Hello, raj's dogs age is 18.
  </code></pre>
  
  <p>Requirements:</p>
  
  <ol>
  <li>Remove Extra space between words.</li>
  <li>allow Capital &amp; Small letter &amp; number &amp; dot(.) &amp; single quotes(').</li>
  <li>Do Not allow space at starting and ending of string.</li>
  </ol>