Home > php教程 > php手册 > 帮我简化一下代码

帮我简化一下代码

WBOY
Release: 2016-06-07 11:39:27
Original
962 people have browsed it

写的比较大,帮我简化一下
 public function url(){         <br>         $xid =I('xid');        <br>         $xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<list>\n"; <br>         if($xid==(44)){   <br>            $xml.='1'."\n";           <br>         }elseif($xid==497){<br>            $xml.='1'."\n";<br>         }elseif($xid==613){<br>            $xml.='1'."\n"; <br>         }elseif($xid==765){<br>            $xml.='1'."\n"; <br>         }else{<br>            $xml.='2'."\n";        <br>         } <br>         $xml .='</list>';<br>         echo $xml ;       <br> }     

AD:真正免费,域名+虚机+企业邮箱=0元

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template