<h3 id="h3--0-"><a name="题目:返回数组中所有的值并给其建立从0开始递增的数字索引" class="reference-link"></a><span class="header-link octicon octicon-link"></span>题目:返回数组中所有的值并给其建立从0开始递增的数字索引</h3><pre class="prettyprint linenums prettyprinted" style=""><ol class="linenums"><li class="L0"><code><span class="pln">$arr </span><span class="pun">=</span><span class="pln"> </span><span class="pun">[</span><span class="lit">4</span><span class="pun">=></span><span class="lit">10</span><span class="pun">,</span><span class="lit">1</span><span class="pun">=></span><span class="lit">22</span><span class="pun">,</span><span class="lit">9</span><span class="pun">=></span><span class="lit">55</span><span class="pun">,</span><span class="lit">0</span><span class="pun">=></span><span class="lit">255</span><span class="pun">];</span></code></li><li class="L1"><code><span class="pln">$ arr2</span><span class="pun">=</span><span class="pln"> array_values</span><span class="pun">(</span><span class="pln">$arr</span><span class="pun">);</span></code></li><li class="L2"><code><span class="pln">print_r</span><span class="pun">(</span><span class="pln">$arr2</span><span class="pun">);</span></code></li></ol></pre>