1) { $i += ($lenEndString - 1); $current = substr($sql, $i, 1); } $start = $i + 1; } $open = false; $endString = ''; } } else { $open = true; if ($current2 == '--') { $endString = "\n"; $comment = true; } elseif ($current2 == '/*') { $endString = '*/'; $comment = true; } elseif ($current == '#') { $endString = "\n"; $comment = true; } else { $endString = $current; } if ($comment && $start < $i) { $query = $query . substr($sql, $start, ($i - $start)); } } } } if ($comment) { $start = $i + 1; } if (($current == ';' && !$open) || $i == $end - 1) { if ($start <= $i) { $query = $query . substr($sql, $start, ($i - $start + 1)); } $query = trim($query); if ($query) { if (($i == $end - 1) && ($current != ';')) { $query = $query . ';'; } $queries[] = $query; } $query = ''; $start = $i + 1; } } return $queries; } }