Trying to get a combine Return() and Exit() in PHP - TechRepublic
Question
July 9, 2009 at 02:00 AM
jvnane

Trying to get a combine Return() and Exit() in PHP

by jvnane . Updated 16 years, 12 months ago

I have this search page on a website that searches files names and sub-directories. Every time a file has been searched the search method calls itself again to search the next file. This is happening inside my include file. When it is at the very end of all the files, (also at the end of a long chain of nested functions) I want to return to the page that the include file was called on. The problem is that if I use exit() then the rest of the code on the main page doesn’t run. If I use return or just nothing at all then it will try returning to the previous function and just mess everything up. How do I return to this page like using an exit command, but still run the rest of the script on that page.

This discussion is locked

All Comments