protected static getTableName ( string $string ) : string | ||
$string | string | part of SQL statement |
return | string | the name of table |
protected static function getTableName($string)
{
if (mb_strstr($string, '.')) {
$temp = explode('.', $string);
$tablename = $temp[1];
} else {
$tablename = $string;
}
$str = explode("\n", $tablename);
$tablename = $str[0];
$tablename = str_replace(';', '', $tablename);
$tablename = str_replace('`', '', $tablename);
$tablename = trim($tablename);
return $tablename;
}