1Using implode() function in Php
2-----------------------
3Syntax
4implode(separator,array);
5
6Example
7<?php
8//assigning value to the array
9$dummyArr = array("Hello","Greppers,","Ankur","here !");
10
11echo implode(" ",$dummyArr);// Use of implode function
12?>
13
14Output:
15Hello Greppers, Ankur here !
1// for one-dimentional arrays
2$str = implode('|', $arr); // "v1|v2|v3"...
3
4// for multi-dimensional/structured arrays, or to keep hierarchy
5$str = json_encode($arr);
6// or
7$str = var_export($arr);