View Full Version : return help
11-22-2003, 05:38 AM
I need to do the equivalent of calling the return construct, (http://www.php.net/manual/en/function.return.php), but from within a function that is on an included script. I want it to end the execution of the included page but not the main page.
11-22-2003, 05:19 PM
Well, then do it
11-22-2003, 05:28 PM
The included page becomes part of the page it is included in as if it were part of that page. If you want a function to stop and return a value then put the return command in and return a value. I don't see where a problem is. Of ocurse you didn't really give us anything to go off of.
11-22-2003, 09:59 PM
Here's why I'm having problems doing it......
I want to stop the xml_parse function halfway through it. IE, once I've parsed 4 news stories, (it's an XML news feed), each of which is contained in an <article> element I want to stop. I tried placing a continue; in the endElement function, but it still writes the rest of the elements' content, just no formatting. If I do a continue(2); I get an error message.
I have figured out how to simply stop printing anything after the first 4 <article> elements however the script is still parsing, which is a waste of resources that I'd like to stop.
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.