php - Printing the content of each subarray on individual lines -


i have array code, :

$responearray = array(); $_counter = 0; foreach ($xmlresp->readcalls->classify $readcalls) {     $classificationclass = array();     foreach ($readcalls->classification->{'class'} $classes) {         $classificationclass[] = implode(" ", array('p' => (string)$classes['p']));     }     $responearray[] = $classificationclass;     $_counter++; } return $responearray; 

that give result like

array (     [0] => array         (             [0] => 0.999999             [1] => 5.65423e-007             [2] => 2.3301e-008         )      [1] => array         (             [0] => 0.333333             [1] => 0.333333             [2] => 0.333333         )      [2] => array         (             [0] => 1.19172e-007             [1] => 0.999993             [2] => 6.75659e-006         ) ) 

my purpose result like

0.999999 5.65423e-007 2.3301e-008 ... 1.19172e-007 0.999993 6.75659e-006 

i tried using this

$responearray = array(); $_counter = 0; foreach ($xmlresp->readcalls->classify $readcalls) {     $classificationclass = array();     foreach ($readcalls->classification->{'class'} $classes) {         $classificationclass[] = implode(" ", array('p' => (string)$classes['p']));     }     $responearray[] = $classificationclass;     $nilaineg = $classificationclass[0];     $nilainet = $classificationclass[1];     $nilaipos = $classificationclass[2];     $_counter++; } return $nilaineg . ' ' . $nilainet . ' ' . $nilaipos; 

but code above outputs:

1.19172e-007 0.999993 6.75659e-006 

am missing something?

i hope you

    $array = array (     array(         0.999999,         5.65423e-007,         2.3301e-008     ),      array     (         0.333333,         0.333333,         0.333333     ),      array     (         1.19172e-007,         0.999993,         6.75659e-006     ) );  foreach($array $item)     print_r(implode(" ", $item)."\n"); 

Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -