public function convertArray2Formatted($type = '', $data = '')
{
$resultString = '';
if ($type == 'json') {
$resultString = json_encode($data);
}
if ($type == 'yaml') {
$resultString = Spyc::YAMLDump($data);
}
return $resultString;
}