01.
<?php defined(
'BASEPATH'
) OR
exit
(
'No direct script access allowed'
);
02.
03.
class
Tel
extends
CI_Model {
04.
public
function
__construct(){
05.
parent::__construct();
06.
}
07.
public
function
number(
$id
){
08.
return
$this
->db->get_where(
'tablephone'
,[
'id'
=>
$id
])->row()->phone??false;
09.
}
10.
}
11.
12.
13.
$tel
=
new
Tel();
14.
echo
$tel
->number(1)?
substr
(
$tel
->number(1)-2):'-- Not Found --;