停止php执行而不只是在codeigniter中的php脚本

I am using Codeigniter for a project and i usually call a series of models (let's say controllerA -> modelA -> modelB -> modelC) for some work. I want the php to stop executing when it reaches some exception where i invoke the exit() command. Now, if the command exit() is invoked in modelB, will it stop execution of only the script of modelB and continue executing rest of the modelA? Or will it stop the entire execution flow.

I really don't know how to put this question here. The question looks quite messy. Please let me know should i need to revise the question itself.

Yes, exit stops all script execution immediately, regardless where you call it.

The opposite is return which only stops execution of the current function (or current file when used at global level in an included file)

Read more here: https://stackoverflow.com/a/9853554/43959

I'm not sure if what you want, but maybe you can use exceptions to control PHP code execution.

http://es.php.net/manual/en/class.exception.php

Regards!

Wherever you call the exit() function, all code will stop executing. This includes the other files because codeigniter just 'requires' them.

Like someone mentions above you should return from a function, or If your in a loop you could use continue or break

It stops the execution from that line.