Utherr12 Posted April 8, 2011 Share Posted April 8, 2011 function JSONtoHTML($json){ $html = ""; $tags = ""; var_dump($json['plugin']); //this shows the JSON structure correctly foreach($json['plugin'] as $plugin) { $html += '<span name="plugin_search" p_name="'.$plugin['id'].'" p_author="'.$plugin['author'].'" p_type="'.$plugin['type'].'">'; $html += '</span>'; echo $html; } return $html; //this function returns 0}$json = json_encode($xml);$json_d = json_decode($json,true);$x = JSONtoHTML($json_d);echo $x; // this will return the whole JSON structure + 9 of 0's because the array has 9 elements I have a problem with this piece of code, help :-s ? Link to comment Share on other sites More sharing options...
jeffman Posted April 8, 2011 Share Posted April 8, 2011 Change += to .= Link to comment Share on other sites More sharing options...
Utherr12 Posted April 8, 2011 Author Share Posted April 8, 2011 Omg, not the javascript again.... /ashamed Link to comment Share on other sites More sharing options...
thescientist Posted April 8, 2011 Share Posted April 8, 2011 Omg, not the javascript again.... /ashamed:)welcome to the club Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.