title: How to use if condition inside string in php
body: <p>I want to know if there is a way to use something like this:</p>
  
  <pre><code>$t1=1;
  $t2=2;
  $t3="$t1&gt;$t2";
  
  if($t3)
     echo "Greater";
  else
     echo "Smaller";
  </code></pre>
  
  <p>This will evaluate to true as $t3 is a string, but that's wrong!!!</p>
  
  <p>So is there a way to include the if condition inside string.</p>
  
  <p>I heard that we can use eval for this:
  <a href="https://stackoverflow.com/questions/3191911/php-if-condition-inside-string">PHP - if condition inside string</a></p>
  
  <p>But how is this possible???</p>