title: Use of undefined constant num - assumed 'num' in C:\xampp\htdocs\Demo\practice4.php on line 12
body: <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
  &lt;meta charset="UTF-8"&gt;
  &lt;title&gt;Practice4&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;?php
              function calculate($number1,$number2)
              {
                  $mult=$number1*$number2;
                  define(num,$mult);
                  return num;
              }
          echo "Number calculated is " . calculate(9,9);
  
  ?&gt;
  </code></pre>
  
  <p>
  </p>
  
  <blockquote>
    <p>Please help me out with this.I am newbie to php.May i know can i return a Constant from a function if yes,Why am i getting  <em>Use of undefined constant num - assumed 'num' .</em></p>
  </blockquote>