title: PHP Str_replace for echo function
body: <p>The following function is part of code written into the core of a plugin I am reverse engineering. The problem with it is that I need to do an str_replace on it and I cannot because it is already set to echo.</p>
  
  <p>The function is.</p>
  
  <pre><code>function similar_posts($args = '') {
      echo SimilarPosts::execute($args);
  }
  </code></pre>
  
  <p>I call it in my pages using <code>similar_posts()</code>, but what I really need to do in my theme is call <code>$related = similar_posts()</code>, however that function is set to echo. How do I change that.</p>
  
  <p>I tried this.</p>
  
  <pre><code> function get_similar_posts($args = '') {
          SimilarPosts::execute($args);
      }
  </code></pre>
  
  <p>But that did not produce any results.</p>