By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,831 Members | 2,237 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,831 IT Pros & Developers. It's quick & easy.

PHP multiThreading

P: 24
Dear Friends

I want to get web page contents with this method :

Expand|Select|Wrap|Line Numbers
  1. function getStatus($url)
  2. {
  3.     $c = curl_init();
  4.     curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
  5.     curl_setopt($c, CURLOPT_URL, $url);
  6.     $contents = curl_exec($c);
  7.     curl_close($c);
  8.     return   $contents ;
  9. }

Is it possible to call Asynchronous this method ?

Thank you.
Sep 2 '08 #1
Share this Question
Share on Google+
1 Reply


Atli
Expert 5K+
P: 5,058
Hi.

I doubt you will be able to do that like you would in event-driven languages (like Java or C#), but you could possibly use the curl_multi_ functions to accomplish your goal. (Depending on what that goal is.)

PHP was designed specifically for web-development, as a "hit-and-run" sort of language. Events and multi-threading doesn't really fit into that schema.
Sep 3 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.