<?php defined('BASEPATH') OR exit('No direct script access allowed');
// PHP 7.0+
class Tel extends CI_Model {
public function __construct(){
parent::__construct();
}
public function number($id){
return $this->db->get_where('tablephone',['id'=>$id])->row()->phone??false;
}
}
//-------------- controller
$tel = new Tel();
echo $tel->number(1)? substr($tel->number(1)-2):'-- Not Found --;