I have 2 functions in PHP and i want to return a value to one function to another. this is my functions
 public function save_payment_log_data($icasl_number, $exam_session) {
$paylog_av = $this->payment_log_exists($icasl_number, $exam_session);
}
function payment_log_exists($icasl_no, $exam_session) {
        $this->db->where('icasl_no', $icasl_no);
        $this->db->where('exam_session', $exam_session);
        $query = $this->db->get('exm_paymentlog');
        if ($query->num_rows() > 0) {
            $pl = $query->row();
            $pay_id = $pl->paylog_id;
            return $pay_id;
        } else {
            return false;
        }
    }
I want to return $pay_id to the save_payment_log_data() function but in here $pay_id didn't return to that function. I think it's return from the function payment_log_exists()
so how can I return $pay_id to the  save_payment_log_data() function
save_payment_log_data()function