PHP Convert Array Keys

前端 未结 4 1861
误落风尘
误落风尘 2021-02-03 23:44

Had a hard time wording this in google so I figure ill ask here.

I have an array like such:

Array ( [a] => \'a\' [b] => \'b\' [c] => \'c\' )
         


        
4条回答
  •  南方客
    南方客 (楼主)
    2021-02-04 00:14

    Use array_values(), as in the manual example:

     "XL", "color" => "gold");
    print_r(array_values($array));
    

    The above example will output:

    Array
    (
        [0] => XL
        [1] => gold
    )
    

提交回复
热议问题