Let $S$ be a commutative semiring and $T(S)$ be the set of all ideals of $S$. Let $\phi\:T(S)\to T(S)\cup \{\emptyset\}$ be a function. A proper ideal $I$ of a semiring $S$ is called an $(n-1,n)$-$\phi$-prime ideal of $S$ if $a_{1}a_{2}\cdots a_{n}\in I\setminus \phi(I)$, $a_{1},a_{2},\dots,a_{n}\in S$ implies that $a_{1}a_{2}\cdots a_{i-1}a_{i+1}\cdots a_{n}\in I$ for some $i\in \{1,2,\dots,n\}$. In this paper, we prove several results concerning $(n-1,n)$-$\phi$-prime ideals in a commutative semiring $S$ with non-zero identity connected with those in commutative ring theory.