print_r($arraydata);
I got output
Array ( [0] => vikas [1] => shirt [2] => cloth1 [3] => test [4] => shirt [5] => cloth2 [6] => avi )
i need to show array like that
$arr = array("vikas","shirt","cloth1","test","shirt","cloth2","avi");
Use this :
echo '$arr = array("'.implode('", "', $arraydata).'");';
[] vs array(), here ya go: echo "[" . implode("', '", $array) . "]";If comma separation is necessary:
echo '$arr = array(';
foreach ($array as $key => $value) {
if ($key > 0) echo ',';
echo '"'.$value.'"';
}
echo ');';
echo implode($arraydata, ',');