public static function splitSql($sql)
	{
		$start   = 0;
		$length  = strlen($sql);
		$queries = [];

		foreach (Str::findLiteral(';', $sql) as $queryEndPosition)
		{
			$queries[] = trim(substr($sql, $start, $queryEndPosition - $start + 1));
			$start     = $queryEndPosition + 1;
		}

		// Grab the last query in case it doesn't end with a ';'
		if ($end = trim(substr($sql, $start)))
		{
			$queries[] = $end;
		}

		return $queries;
	}
public static function splitSql($sql)
	{
		$start   = 0;
		$length  = strlen($sql);
		$queries = [];

		foreach (Str::findLiteral(';', $sql) as $queryEndPosition)
		{
			$queries[] = trim(substr($sql, $start, $queryEndPosition - $start + 1));
			$start     = $queryEndPosition + 1;
		}

		// Grab the last query in case it doesn't end with a ';'
		if ($end = trim(substr($sql, $start)))
		{
			$queries[] = $end;
		}

		return $queries;
	}
public static function splitSql ( $ sql ) { $ start = 0 ; $ length = strlen ( $ sql ) ; $ queries = [ ] ; foreach ( Str :: findLiteral ( ';' , $ sql ) as $ queryEndPosition ) { $ queries [ ] = trim ( substr ( $ sql , $ start , $ queryEndPosition - $ start + 1 ) ) ; $ start = $ queryEndPosition + 1 ; } // Grab the last query in case it doesn't end with a ';' if ( $ end = trim ( substr ( $ sql , $ start ) ) ) { $ queries [ ] = $ end ; } return $ queries ; }
Splits a string of multiple queries into an array of individual queries

@param   string  $sql  Input SQL string from which to split into individual queries
@return  array
@since   2.0.0
Splits a string of multiple queries into an array of individual queries