https://lavrynenko.com/uroki-php-while-endwhile/
Уроки PHP - while - endwhile