title: How can strip whitespaces in PHP's variable?
body: <p>I know this <a href="http://fi.php.net/manual/en/function.trim.php#72562" rel="noreferrer">comment</a> PHP.net.
  I would like to have a similar tool like <code>tr</code> for PHP such that I can run simply</p>
  
  <pre><code>tr -d " " ""
  </code></pre>
  
  <p>I run unsuccessfully the function <code>php_strip_whitespace</code> by</p>
  
  <pre><code>$tags_trimmed = php_strip_whitespace($tags);
  </code></pre>
  
  <p>I run the regex function also unsuccessfully</p>
  
  <pre><code>$tags_trimmed = preg_replace(" ", "", $tags);
  </code></pre>