现在用的方法是
这样做似乎很笨. 请问有什么简单的写法?
<code class="language-php"><span class="cp"><?php </span> <span class="sd">/**</span> <span class="sd"> * Created by PhpStorm.</span> <span class="sd"> * User: huage.org</span> <span class="sd"> * Date: 2014-09-06</span> <span class="sd"> * Time: 13:43</span> <span class="sd"> */</span> <span class="nv">$array1</span><span class="o">=</span><span class="k">array</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="mi">3</span><span class="p">,</span><span class="mi">4</span><span class="p">);</span> <span class="nv">$array2</span><span class="o">=</span><span class="k">array</span><span class="p">(</span><span class="s2">"林志玲"</span><span class="p">,</span><span class="s2">"刘涛"</span><span class="p">,</span><span class="s2">"隋唐"</span><span class="p">,</span><span class="s2">"朱茵"</span><span class="p">);</span> <span class="nv">$array3</span><span class="o">=</span><span class="k">array</span><span class="p">(</span><span class="s2">"刘涛"</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="s2">"朱茵"</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="s2">"林志玲"</span><span class="p">);</span> <span class="k">echo</span> <span class="nb">end</span><span class="p">(</span><span class="nv">$array1</span><span class="p">);</span><span class="c1">//将数组的内部指针指向最后一个单元,适用于所有数组</span> <span class="k">echo</span> <span class="s2">"<br>"</span><span class="p">;</span> <span class="k">echo</span> <span class="nb">end</span><span class="p">(</span><span class="nv">$array2</span><span class="p">);</span> <span class="k">echo</span> <span class="s2">"<br>"</span><span class="p">;</span> <span class="k">echo</span> <span class="nb">end</span><span class="p">(</span><span class="nv">$array3</span><span class="p">);</span> </span></code>