$db->exec('UPDATE as SET b=c WHERE d=1; UPDATE as SET b=e WHERE d=2; UPDATE as SET b=f WHERE d=3');
$db->query('UPDATE as SET b=c WHERE d=1; UPDATE as SET b=e WHERE d=2; UPDATE as SET b=f WHERE d=3')->fetchAll(PDO::FETCH_NUM);
$data = array('str1', 'str2', 'str3', 'str4', 'str5');
$c=count($data)-1;
$a='';
for($i=$c;$i>=0;$i--)
{
if($i==$c)
$a=array($data[$i]);
else
$a=array($data[$i],'sub'=>$a);
}
print_r($a);
pear install mail
pear install net_smtp
pear install mail_mime
require_once ('Mail.php'); // PEAR Mail package
require_once ('mime.php'); // PEAR Mail_Mime packge
$from = "sender@example.com";
$to = "recipient@example.com";
$subject = 'SUBJECT';
$headers = array ('From' => $from,'To' => $to, 'Subject' => $subject);
$text = 'TEXT'; // text and html versions of email.
$crlf = "\n";
$mime = new Mail_mime($crlf);
$host = "smtp.example.com";
$username = "user@example.com";
$password = "pass";
$smtp = Mail::factory('smtp', array ('host' => $host, 'auth' => true,
'username' => $username,'password' => $password));
$mime->setTXTBody($text);
$body = $mime->get();
$headers = $mime->headers($headers);
$mail = $smtp->send($to, $headers, $body);
if (PEAR::isError($mail)) {
echo("<p>" . $mail->getMessage() . "</p>");
}
else {
echo("<p>Message successfully sent!</p>");
}
Сейчас на каждый посылаемый запрос создается помимо «обычного» потока (curl_init) еще один мульти-поток (curl_multi_init). Надо было написать быстро, не стал тестировать