1$array = array('banana', 'strawberry', 'apple');
2comma_separated = implode(",", $array);
3echo comma_separated; // banana,strawberry,apple
1$arr = array('Hello','World!','Beautiful','Day!');
2echo implode(" ",$arr);
3// Outputs: 'Hello World! Beautiful Day!'
1<?php
2$arr = array('cat','dog','elephent');
3// it will convert array to string
4$str = implode(', ',$arr);
5echo $str;
6?>