171) { $cutContent = substr($cleanContent, 0, strpos($cleanContent, ' ', 171)); // var_dump($cutContent); $removeFirstThree = str_ireplace('#', '', $cutContent); $removeEmpty = preg_replace('/\s*$/', '', $removeFirstThree); // foreach(explode(" ", $removeEmpty) as $text) { // var_dump(textBinASCII($text)); // } $cleanChar = preg_replace('/[^A-Za-z0-9 !@#$%^&*().]/u', '', strip_tags($removeEmpty)); $arrText = array_filter(explode(' ', $cleanChar)); return implode(' ', $arrText); } return $content; } function createFilePath() { $path = FCPATH . 'assets/files/'; $year_folder = $path . date('Y'); $month_folder = $year_folder . '/' . date('m'); !file_exists($year_folder) && mkdir($year_folder, 0777); !file_exists($month_folder) && mkdir($month_folder, 0777); $path = $month_folder; return $path . $month_folder; } function uniqeID() { return base_convert(rand(1000000000, PHP_INT_MAX), 10, 36); } function getFileName($filecomplete) { return pathinfo($filecomplete, PATHINFO_FILENAME); } function getFileNameExt($filecomplete) { return pathinfo($filecomplete, PATHINFO_BASENAME); } function getFileExt($filecomplete) { return '.' . pathinfo($filecomplete, PATHINFO_EXTENSION); } function clearText($text) { $string = str_replace(["\r", "\n"], '', trim($text)); return strtolower($string); } function notallowed($filename) { if (preg_match('(BAB III|BAB IV|BAB_III|BAB_IV)', $filename) === 1) { return false; } else { return true; } }