I'm trying to make an environment that wraps a for loop:
\documentclass{article}
\usepackage[utf8]{inputenc}
\title{Testing}
\author{This is a Name}
\date{June 2022}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\begin{document}
\maketitle
\newenvironment{fora}{
\pgfplotsforeachungrouped \i in {0,1,...,5} {
} {
}
}
\begin{fora}
\textit{meow}
\end{fora}
\end{document}
I get this error on overleaf at \end{fora}:
Missing \endcsname inserted.
TeX capacity exceeded, sorry [input stack size=5000].
My intended goal was for "meow" to be printed 5 times. Any ideas on what is wrong? I'm guessing it's an issue related to the nested curly brackets.

environpackage to grab the body. – user202729 Jun 19 '22 at 17:54