Am running a script that checks every line in a foreach loop. I would like help in how to tackle this each execution needs to be written to a log file which will show how log it went to process the each line at a time and if there is an error it will break the loop and display the log file.
I was thinking of a try catch or is there a class I can try thanks
You can write the log to file (personally I like log4php), but you could also keep it in memory and output it only if there is a problem. Depends on whether or not you want to keep the log files for a longer period.