How to separate an array with commas in PHP - Coding Cyber

How to separate an array with commas in PHP

[adrotate group="5"]

Separating an array with commas in PHP, we are separating an array with PHP’s function implode, first we are using an array of sample values and assigning it to an $array variable. then we are passing two arguments to implode function one is separator, what we want to separate the array with, ane the next one the array.

<?php
$array = array('hi', 'this', 'is', 'an', 'array');
$comma_list = implode(', ', $array);
echo $comma_list;
?>

Hire Me if you have any work.

Vivek Vengala
 

Vivek Vengala is a Online Entrepreneur, Web Developer from Hyderabad India.

Click Here to Leave a Comment Below 0 comments

Leave a Reply: