Я запрограммировал скрипт с помощью команды goto
, но на сервере, где я хочу выполнить скрипт, есть предыдущая версия PHP (<5.3), поэтому я должен изменить код. Структура кода выглядит так: </p>
for($i = 0; $i < 30; $i++) // print 30 articles
{
$x = 0;
// choose a a feed from the db
// parse it
a:
foreach($feed->get_items($x, 1) as $item)
{
// create a unique id for the article of the feed
if($id == $dbid)
{
// if this id exists in the db, take the next article of the same feed which is not in the db
$x++;
goto a;
}
else
{
// print the original article you grabbed
}
} // end of foreach
} // end of for
Я все проверил. Есть ли у вас какие-либо идеи, как я могу преобразовать этот код без goto
для правильного выполнения ???