In this example we using only a Controller file for upload split date.
Here is the Controller file hello.php which inside controllers folder
controllers/hello.php
<?php
class Hello extends Controller {
function __construct() {
parent::__construct();
}
function split_date_2(){
$orderdate="23-10-2017";
$orderdate = explode('-', $orderdate);
$day = $orderdate[1];
$month = $orderdate[0];
$year = $orderdate[2];
echo $day."";
echo $month."";
echo $year;
}
}
?>
<?php
class Hello extends Controller {
function __construct() {
parent::__construct();
}
function split_date(){
$orderdate="23/10/2017";
$orderdate = explode('/', $orderdate);
$day = $orderdate[1];
$month = $orderdate[0];
$year = $orderdate[2];
echo $day."";
echo $month."";
echo $year;
}
}
?>