passing function values to another function in same class
<p>I want to pass function values to another function in the same class, like to store some values in a variable and then call this variable in another function in the same class.</p>

<p>Here is my Code</p>

<pre><code>public function ven_coupon()
    {
        if ($_POST) {
            $number = $_POST['coupon'];
            $query = $this-&gt;front-&gt;ven_coupon($number);
            if (count($query) &lt;= 0 ) {
                echo "Not Valid";
            }
            $payment = $this-&gt;cart-&gt;total();
            $dis = $query['discount'];
            $name = $query['username'];
            $number = $query['number'];
            $discount['discount'] = ($payment*$dis)/100;
            $discount['data'] = $dis;
            $this-&gt;load-&gt;view('checkout',$discount);
        }
    }

    public function addcart()
    {
        $ven = $this-&gt;ven_coupon();
        echo $ven($name);
        echo $ven($dis);
        echo $ven($number);
    }
</code></pre>