How to comma separate the values of an array for display

后端 未结 3 767
南方客
南方客 2021-01-02 16:30

I have searched the PHP.net site and originally thought of some use for the list() function but doesn\'t seem to accomplish the goal:

I have an unknown

3条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-02 17:28

    You can simply use PHP's implode function for this purpose as follows:

    $string = implode(',', array(1,2,3,4,5));
    

提交回复
热议问题