How to send multiple URLs simultaneously with PHP?

I wanted to send different url at same time.this is the code which i used.Can you please tell me the error in here?

<?php
    $data = R::find('savedata','list_name = ? order by id desc',array($i));

    foreach ( $data as $list):
        $mh = curl_multi_init(); //set up a cURL multiple execution handle
        $ch = curl_init("https://example.com/save_data.php?NUM=$list->id&MSG=$message"); 
        curl_setopt($ch, CURLOPT_TIMEOUT, 2);           
        curl_multi_add_handle($mh, $ch); 
    endforeach; 

    curl_multi_exec($mh,);                          
    curl_multi_close($mh)
?>

Answers


Thank you all.I have corrected this by my self.I am sharing the correct code with you,

$mobile = R::find('add_numbers', 'list_name = ? order by id desc', array($i));

foreach ($mobile as $list):
    try{
  $url = "https://example.com/save_data.php?NUM=$list->id&MSG=****";
    $ch = curl_init($url);

   curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); // TRUE
   curl_setopt($ch, CURLOPT_HEADER, 0); // DO NOT RETURN HTTP HEADERS
   curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // RETURN THE CONTENTS OF THE CALL
   curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
   $results = curl_exec($ch);
     $i[]=$results;
    }

Need Your Help

How can I add links to an android menu?

android android-layout

I'm building an android app. I'm currently using the WebView. How would I go about creating Internet links from the popup menu (3 dots on the top right)? And how would I open them within the WebVie...

fabric appears to start apache2 but doesn't

ssh ubuntu-10.04 python-2.6 fabric apache2.2

I'm using fabric to remotely start a micro aws server, install git and a git repository, adjust apache config and then restart the server.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.