<?php

namespace App\Http\Controllers;

class FunctionsController{
    public function orderDate($date){
        $arrDate = explode("-", $date);
        $arrDate = array_reverse($arrDate);
        return implode("/", $arrDate);
    }

    public function joinName($name, $apeP, $apeM){
        $cName = "$name $apeP";
        if(!is_null($apeM)) $cName .= " $apeM";
        $cName = str_replace("  ", " ", $cName);
        $cName = str_replace("-", "", $cName);
        $cName = trim($cName);
        return $cName;
    }
}