virajj Posted December 17, 2007 Share Posted December 17, 2007 Hi All, I could execute the following code: <?php $soap = new SoapClient("http://soap.genome.jp/KEGG.wsdl"); $offset=1; $limit=2; $top2 = $soap->get_best_neighbors_by_gene('eco:b0002',$offset,$limit); print_r($top2); ?> This gives me the following output: Array ( [0 ] => stdClass Object ( [genes_id1] => eco:b0002 [genes_id2] => ecv:APECO1_1976 [sw_score] => 5283 [bit_score] => 1210 [identity] => 1 [overlap] => 820 [start_position1] => 1 [end_position1] => 820 [start_position2] => 15 [end_position2] => 834 [best_flag_1to2] => 1 [best_flag_2to1] => 1 [definition1] => bifunctional aspartokinase I/homeserine dehydrogenase I [definition2] => bifunctional aspartokinase I/homeserine dehydrogenase I [length1] => 820 [length2] => 834 ) [1] => stdClass Object ( [genes_id1] => eco:b0002 [genes_id2] => ecp:ECP_0002 [sw_score] => 5283 [bit_score] => 1210 [identity] => 1 [overlap] => 820 [start_position1] => 1 [end_position1] => 820 [start_position2] => 1 [end_position2] => 820 [best_flag_1to2] => 1 [best_flag_2to1] => 1 [definition1] => bifunctional aspartokinase I/homeserine dehydrogenase I [definition2] => aspartokinase I/homoserine dehydrogenase I [length1] => 820 [length2] => 820 ) ) What should be my code, to retrieve the value of "genes_id1" or for any other entry. I tried using "foreach" loop, but couldnt get it printed out. Any help would be greatly appreciated. Thanks, Vijay Link to comment https://forums.phpfreaks.com/topic/82035-php-soap-how-to-extract-from-response/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.