title: call php function and using global variable inside php function
body: <p>I want to enable a control based on the user input.. if user click yes i want to display it else hide it.. so i called a function and assigned value based on that i want to display the control..</p>
  
  <p>This is the php Function</p>
  
  <pre><code>&lt;?
  $hscEnable="false";
  function HSControl($val) 
  {
      if($val=="yes")
      {
          return("true");
      }
      else
      {
          return("false");    
      }
  }
  ?&gt;
  </code></pre>
  
  <p>I have called it from html form </p>
  
  <pre><code>&lt;input type="radio" name="twelthStudiedStatus" value="no" id="twelthStudiedStatus_1" checked onClick= &lt;? $hscEnable=HSControl("no"); ?&gt; &gt;
  
    &lt;? if($hscEnable=="true"){ ?&gt;
    &lt;tr&gt;
      &lt;td&gt;Percentage :&lt;/td&gt;
      &lt;td&gt;&lt;input type="text" name="twelthPercentage" /&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;?  } ?&gt;
  </code></pre>