-3

I want to get the array result in a plain text area and each result separated with " , ".

PHP codes :

  • $nbrs = json_decode(fBGetDataStore('neighbors'), true);
  • <?= count($nbrs) ?> (to count $nbrs)
  • print_r($nbrs) (to get FBID $nbrs)

The results :

FBID of Your available Nbrz: Array
(
    [242] => 100001358797416,
    [243] => 100000859795350,
    [244] => 100000843343992,
    [247] => 100000257661280,
    [248] => 100000351371568,
    [249] => 1349056951,
    [251] => 100000805381194,
)
1

This is the result I want:

FBID of Your available Nbrz:

100000348365067,100005373581538
Nony
  • 25
  • 4
Aryan Aly
  • 208
  • 3
  • 9
  • `implode($nbrs);` http://php.net/implode – cmorrissey Apr 13 '15 at 18:55
  • no 2 is incomplete making correction " counting $nbrs i'm using " = count($nbrs) ?> " – Aryan Aly Apr 13 '15 at 18:58
  • implode($nbrs) is worked but i want separate each figure with comma .. right now the results are http://prntscr.com/6tbwk6 @cmorrissey – Aryan Aly Apr 13 '15 at 19:03
  • read the docs with the link i provided above! – cmorrissey Apr 13 '15 at 19:07
  • Thank you so much @cmorrissey done it http://prntscr.com/6tc01d Result http://prntscr.com/6tc0l7 – Aryan Aly Apr 13 '15 at 19:08
  • Friendly advice: you really need to put more effort into the creation of your question. Don't give us your code as images on an external site. Instead, include it in your question and format it properly. – tmt Apr 13 '15 at 19:08
  • sure i'll @cascaval and sorry for now i'm new here – Aryan Aly Apr 13 '15 at 19:10
  • 1
    I know you are new and that's why I'm giving you the advice. If you want good answers, you need to come come up with a good question. A good question is the one which is clear, easy to comprehend and states what you expect and what you have tried. The reason why you are being downvoted is because your question doesn't meet this. – tmt Apr 13 '15 at 19:14
  • thank you once again and i will try my best in future . – Aryan Aly Apr 13 '15 at 19:27
  • I edited your question to include the screen shots as inline code :) – mhall Apr 13 '15 at 20:05

1 Answers1

0

You should try:

$nbrs = implode(",",$nbrs);

Docs: http://php.net/implode

Hackerman
  • 12,139
  • 2
  • 34
  • 45