472,121 Members | 1,567 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,121 software developers and data experts.


How can I stop a function in PHP?

When comparing data I want to stop the function on a hit.

Function compare($data) {

For ($n=1; $n<=10000; $n++) {

For ($m=1; $m<=10000; $m++) {

If $data[$n]==data[$m] {

Apr 8 '06 #1
1 1230
Piet wrote:
How can I stop a function in PHP?

By calling return;

function example()
return; // stop here

echo "test"; // This is never executed
Apr 8 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

13 posts views Thread by MrCoder | last post: by
8 posts views Thread by Vincent | last post: by
11 posts views Thread by Russ Green | last post: by
5 posts views Thread by antani | last post: by
26 posts views Thread by neha_chhatre | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.