Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
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] {


                  Exit function, or exit for.. --- but how?




How can I avoid comparing 10000 * 10000 times?



Re: compare

Piet wrote:
Quoted text here. Click to load it

By calling return;

function example()
   return; // stop here

   echo "test"; // This is never executed

Site Timeline