欧美亚洲中文,在线国自产视频,欧洲一区在线观看视频,亚洲综合中文字幕在线观看

      1. <dfn id="rfwes"></dfn>
          <object id="rfwes"></object>
        1. 站長(zhǎng)資訊網(wǎng)
          最全最豐富的資訊網(wǎng)站

          php如何在不去重的情況下對(duì)數(shù)組排序

          php在不去重的情況下對(duì)數(shù)組排序的方法:【$cars=array("porsche","BMW","Volvo");sort($cars);】,表示按照字母升序?qū)?shù)組中的元素進(jìn)行排序。

          php如何在不去重的情況下對(duì)數(shù)組排序

          函數(shù)介紹:

          sort() – 以升序?qū)?shù)組排序

          rsort() – 以降序?qū)?shù)組排序

          (推薦教程:php視頻教程)

          舉例:

          按照字母升序?qū)?shù)組 $cars 中的元素進(jìn)行排序

          代碼實(shí)現(xiàn):

          <?php $cars=array("porsche","BMW","Volvo"); sort($cars); ?>

          按照數(shù)字升序?qū)?shù)組 $numbers 中的元素進(jìn)行排序

          代碼實(shí)現(xiàn):

          <?php $numbers=array(3,5,1,22,11); sort($numbers); ?>

          按照字母降序?qū)?shù)組 $cars 中的元素進(jìn)行排序

          <?php $cars=array("porsche","BMW","Volvo"); rsort($cars); ?>

          按照數(shù)字降序?qū)?shù)組 $numbers 中的元素進(jìn)行排序

          <?php $numbers=array(3,5,1,22,11); rsort($numbers); ?>

          贊(0)
          分享到: 更多 (0)
          網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)