tag:blogger.com,1999:blog-2795235531512692723.post4912624042734385249..comments2023-05-19T22:14:01.202+08:00Comments on My Coding World: Day 15 Exe PHP: FunctionUnknownnoreply@blogger.comBlogger3125tag:blogger.com,1999:blog-2795235531512692723.post-50677983180654462442012-07-02T09:23:29.455+08:002012-07-02T09:23:29.455+08:00<?phpfunction create_list($arr){ echo "<...<?php<br>function create_list($arr){<br> echo "<ul>";<br> foreach ($arr as $item){ <br> echo "<li>".$item."</li>";<br> }<br> echo "</ul>";<br>}<br><br>$myArray = array(2, 5, 1, 7, 3);<br>create_list($myArray);<br>?>irenehttps://www.blogger.com/profile/11356352817158569840noreply@blogger.comtag:blogger.com,1999:blog-2795235531512692723.post-51369446410139259302012-07-02T09:12:46.014+08:002012-07-02T09:12:46.014+08:00thanks for trying, but it's not the correct an...thanks for trying, but it's not the correct answer.irenehttps://www.blogger.com/profile/11356352817158569840noreply@blogger.comtag:blogger.com,1999:blog-2795235531512692723.post-44779082964644810412012-07-02T00:20:13.665+08:002012-07-02T00:20:13.665+08:00<?php function my_array($num1,$num2,$num3){...<?php <br> function my_array($num1,$num2,$num3){<br> $total_num1=$num1[0]+$num2[0]+$num3[0];<br> $total_num2=$num1[1]+$num2[1]+$num3[1];<br> $total_num3=$num1[2]+$num2[2]+$num3[2];<br> $answer=array();<br> $answer[0]=$total_num1;<br> $answer[1]=$total_num2;<br> $answer[2]=$total_num3;<br> return $answer;<br> }<br> $num1=array(5,1,2);<br> $num2=array(2,3,5);<br> $num3=array(11,3,7);<br> $result=my_array($num1, $num2,$num3);<br> echo "<ul>";<br> echo "<li>".$result[0]."</li><br/>";<br> echo "<li>".$result[1]."</li><br/>";<br> echo "<li>".$result[2]."</li><br/>";<br> echo "</ul>";<br>?><br>Anonymoushttps://www.blogger.com/profile/16887981459550883748noreply@blogger.com