title: PHP: Replace php code in string
body: <p>I want replace php codes in string and running fro server</p>
  
  <pre><code>$x = 1;
  $string = "OK:{first}Yes{second}No";
  </code></pre>
  
  <p>I want <code>replace if($x == 1){</code> to <code>{first}</code> and <code>} else {</code> to <code>{second}</code></p>
  
  <p>After run and <code>echo $string</code> , I want result in html :</p>
  
  <blockquote>
    <p>OK:Yes</p>
  </blockquote>