codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
<?php $str = '[{"x":"12345","y":"john"},{"x":"12345","y":"stars"}]'; function getCSV($x) { $arr = json_decode($x); $y = array(); foreach($arr as $obj){ $y[] = $obj->y; } echo implode(',', $y); } getCSV($str);
Private
[
?
]
Run code
Submit