title: Creating my own Helper in Codeigniter
body: <p>Just learning PHP and Codeigniter at the moment and I'm stuck on a trivial one. I created a helper to calculate a percentage of two numbers:</p>
  
  <pre><code>    # Below is the Helper
  
      function percentage($num1 = NULL, $num2 = NULL)
      {           
          $res = $num1/$num2*100;
  
          return $res;
      }
  </code></pre>
  
  <p>Now I call the helper function in the controller using the below code:</p>
  
  <pre><code>    public function tester()
      {
          $this-&gt;load-&gt;helper('sums_helper');
  
          $num1 = 36;
          $num2 = 137;
  
          percentage($num1, $num2);
  
          // Need to print the result here.
          // Tried: $percentage-&gt;$res;
  
      }
  </code></pre>
  
  <p>I call the function and pass over the two required variables however cannot print the result. Any suggestions would be greatfuly appreciated.</p>
  
  <p>Thank you in advance!! Niall </p>