views:

58

answers:

1

Hi everyone, I want to do an application that sends data to specified ip range.However,i faced a problem like this.When i put fsockopen function in a loop the code returns nothing and the page(browser page) is alwalys loading mode.When i do a single fsockopen to google it works but when i do it in a loop it doesnt... Thanks for advance...

A: 

It definitely should work in a loop as well.

Maybe you used the same variable for the result ?

Try storing the connection resources in an array:

 $connections = array();
 foreach($ips as $ip ) {
        $connections[] = fsockopen( $ip );
 }
Alex