Go Back   SitePoint Forums > Forum Index > Program Your Site > PHP
Newsletter FAQ Members List Calendar Mark Forums Read

New to SitePoint Forums? Register here for free!

SitePoint Sponsor
 
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old Sep 15, 2006, 10:55   #1
DavidPesta
SitePoint Enthusiast
 
Join Date: Mar 2006
Posts: 25
Cannot continue from an include file invoked from inside a loop

Here is the code:

loop.php:
PHP Code:

<?php


for($i = 1; $i <= 10; $i++) {
  include
"includefile.php";
}

?>
includefile.php:
PHP Code:

<?php


if($i != 6) echo $i . "<br>";
else continue;

?>
Result:
Code:
1
2
3
4
5

Fatal error: Cannot break/continue 1 level in /var/www/html/test/loop/includefile.php on line 4
Is there any way to make this work?

Thanks!
David
DavidPesta is offline   Reply With Quote
 

Bookmarks

« Previous Thread | Next Thread »

Thread Tools
Display Modes

 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Sponsored Links
 
Forum Jump


All times are GMT -7. The time now is 00:44.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright 1998-2009, SitePoint Pty Ltd. All Rights Reserved