Error: Warning: sprintf () [& amp; lt; ahref & #039; function. sprintf & #039; & amp; gt; function. sprintf & amp; lt; a & amp; gt;]: Toofewargumentsinexample. phponline225. Is this sentence incorrect? Baidu cannot find the answer {code...} error:
Warning: sprintf() [function.sprintf]: Too few arguments inexample.php on line 225。
Is this sentence incorrect? Baidu cannot find the answer
$result = sprintf($newsTpl,$object->FromUserName,$object->ToUserName,time(),count($arr_item));
Private function deleetext ($ object) {$ keyword = trim ($ object-> Content); if ($ keyword = "text") {$ content = "this is a text. "; $ result = $ this-> transmitText ($ object, $ content);} else if ($ keyword =" "| $ keyword =" ") {$ content = array (); $ content [] = array ("Title" => "Single Text Title", "Descrption" => "Single Text content ", "PicUrl" =>" http://v1.qzone.cc/pic/201602/12/15/12/56bd85d5cb22d067.jpg%21600x600.jpg "," Url "=>" http://m.cnblogs.com/?u=txw1958 "); $ Result = $ this-> transmitNews ($ object, $ content);} else if ($ keyword =" Multi-image ") {$ content = array (); $ content [] = array ("Title" => "Multi-text Title 1", "Descrption" => "text content", "PicUrl" =>" http://v1.qzone.cc/pic/201602/12/15/12/56bd85d5cb22d067.jpg%21600x600.jpg "," Url "=>" http://m.cnblogs.com/?u=txw1958 "); $ Content [] = array (" Title "=>" Multi-text Title 2 "," Descrption "=>" graphic content "," PicUrl "=>" http://v1.qzone.cc/pic/201602/12/15/12/56bd85d5cb22d067.jpg%21600x600.jpg "," Url "=>" http://m.cnblogs.com/?u=txw1958 "); $ Content [] = array (" Title "=>" Multi-text Title 3 "," Descrption "=>" graphic content "," PicUrl "=>" http://v1.qzone.cc/pic/201602/12/15/12/56bd85d5cb22d067.jpg%21600x600.jpg "," Url "=>" http://m.cnblogs.com/?u=txw1958 "); $ Result = $ this-> transmitNews ($ object, $ content);} else if ($ keyword =" Music ") {$ content = array ("Title" => "July", "Descrption" => "jam", "MusicUrl" =>" http://sc1.111ttt.com/2015/5/12/28/105281351446.mp3 "," HQMusicUrl "=>" http://sc1.111ttt.com/2015/5/12/28/105281351446.mp3 "); $ Result = $ this-> transmitMusic ($ object, $ content);} return $ result;} private function transmitNews ($ object, $ arr_item) {if (! Is_array ($ arr_item) return; $ itemTpl ="
<! [CDATA [% s]>
%s
%s
%s
"; $ Item_str =" "; foreach ($ arr_item as $ item) {$ item_str. = sprintf ($ itemTpl, $ item ['title'], $ item ['description'], $ item ['picurl'], $ item ['url']);} $ newsTpl ="
%s
%s
% S
news
% S$ Item_str
"; $ Result = sprintf ($ newsTpl, $ object-> FromUserName, $ object-> ToUserName, time (), count ($ arr_item); return $ result ;}
Reply content:
Error:Warning: sprintf() [function.sprintf]: Too few arguments inexample.php on line 225。
Is this sentence incorrect? Baidu cannot find the answer
$result = sprintf($newsTpl,$object->FromUserName,$object->ToUserName,time(),count($arr_item));
Private function deleetext ($ object) {$ keyword = trim ($ object-> Content); if ($ keyword = "text") {$ content = "this is a text. "; $ result = $ this-> transmitText ($ object, $ content);} else if ($ keyword =" "| $ keyword =" ") {$ content = array (); $ content [] = array ("Title" => "Single Text Title", "Descrption" => "Single Text content ", "PicUrl" =>" http://v1.qzone.cc/pic/201602/12/15/12/56bd85d5cb22d067.jpg%21600x600.jpg "," Url "=>" http://m.cnblogs.com/?u=txw1958 "); $ Result = $ this-> transmitNews ($ object, $ content);} else if ($ keyword =" Multi-image ") {$ content = array (); $ content [] = array ("Title" => "Multi-text Title 1", "Descrption" => "text content", "PicUrl" =>" http://v1.qzone.cc/pic/201602/12/15/12/56bd85d5cb22d067.jpg%21600x600.jpg "," Url "=>" http://m.cnblogs.com/?u=txw1958 "); $ Content [] = array (" Title "=>" Multi-text Title 2 "," Descrption "=>" graphic content "," PicUrl "=>" http://v1.qzone.cc/pic/201602/12/15/12/56bd85d5cb22d067.jpg%21600x600.jpg "," Url "=>" http://m.cnblogs.com/?u=txw1958 "); $ Content [] = array (" Title "=>" Multi-text Title 3 "," Descrption "=>" graphic content "," PicUrl "=>" http://v1.qzone.cc/pic/201602/12/15/12/56bd85d5cb22d067.jpg%21600x600.jpg "," Url "=>" http://m.cnblogs.com/?u=txw1958 "); $ Result = $ this-> transmitNews ($ object, $ content);} else if ($ keyword =" Music ") {$ content = array ("Title" => "July", "Descrption" => "jam", "MusicUrl" =>" http://sc1.111ttt.com/2015/5/12/28/105281351446.mp3 "," HQMusicUrl "=>" http://sc1.111ttt.com/2015/5/12/28/105281351446.mp3 "); $ Result = $ this-> transmitMusic ($ object, $ content);} return $ result;} private function transmitNews ($ object, $ arr_item) {if (! Is_array ($ arr_item) return; $ itemTpl ="
<! [CDATA [% s]>
%s
%s
%s
"; $ Item_str =" "; foreach ($ arr_item as $ item) {$ item_str. = sprintf ($ itemTpl, $ item ['title'], $ item ['description'], $ item ['picurl'], $ item ['url']);} $ newsTpl ="
%s
%s
% S
news
% S$ Item_str
"; $ Result = sprintf ($ newsTpl, $ object-> FromUserName, $ object-> ToUserName, time (), count ($ arr_item); return $ result ;}