php how can set counter limit?

Code:
$result = $request->getResponseText();
                if ( is_string($result) )
                {
                    $result = json_decode($result);
                    if ( is_object($result) )
                    {
                        if ($result->status == 'ok') $this->_result++;
                        [COLOR=#ff0000]if ($this->_result > 11) exit();[/COLOR]
            
            }
                }

Maybe the code in red would do the trick.
 
Code:
$result = $request->getResponseText();
                if ( is_string($result) )
                {
                    $result = json_decode($result);
                    if ( is_object($result) )
                    {
                        if ($result->status == 'ok') $this->_result++;
                        [COLOR=#ff0000]if ($this->_result > 11) exit();[/COLOR]
            
            }
                }

Maybe the code in red would do the trick.

This works but it'll exit the script and everything that comes after it. If you want to continue doing something else below, just use break instead of exit()

if ($this->_result > 11) break;
 
Wish there was some code commenting here. lol. Looks like you are coding a great application or working with a decently coded one for accomplishing a like of what? Clearly looks like a fb or youtube oriented script. Way to go.
 
not solve my problem. anybody php coder can help me on teamviewer? my skype: alejandro23244
 
Back
Top