-4

eg.

 ['key' => 'value', 'key2' => 'value2']

to

 ['key', 'value', 'key2', 'value2']

Also, how do I get comma separated string from said array?

Default
  • 684
  • 9
  • 19
  • 1
    Possible duplicate of [echo key and value of an array without and with loop](https://stackoverflow.com/questions/3406726/echo-key-and-value-of-an-array-without-and-with-loop) – Tom Udding Feb 27 '18 at 06:04
  • https://3v4l.org/pqPVs lol – Lawrence Cherone Feb 27 '18 at 06:05
  • Your question is Unclear and Too Broad because you have not attempted to code a solution yourself. We don't know if you want a string with double-quote-wrapped comma-separated values, or if you actually want a 1-dimensional array. – mickmackusa Feb 27 '18 at 07:08
  • Wanted it as 1-dimensional array or you can say comma seperated string – Pratik Bhatt Feb 27 '18 at 07:44

1 Answers1

0

Try to do something like that

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

It will echo string "key, value, key2, value2"

Default
  • 684
  • 9
  • 19