How to comma separate the values of an array for display

后端 未结 3 752
南方客
南方客 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:14

    You can make use of list() function if you know there are only 3 values.

    $array = array('Life', 'living', 'Health');
    list($life, $living, $health) = $array;
    
    echo $life;
    echo $living;
    echo $health;
    

    Note - you can make use of implode function as well.

提交回复
热议问题