Display array values in PHP

前端 未结 9 2285
名媛妹妹
名媛妹妹 2020-12-01 07:51

So, I\'m working with PHP for the first time and I am trying to retrieve and display the values of an array. After a lot of googling, the only methods I can find for this ar

9条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-01 08:06

    use implode(',', $array); for output as apple,banana,orange

    Or

    foreach($array as $key => $value)
    {
       echo $key." is ". $value;
    }
    

提交回复
热议问题