Utherr12 Posted April 8, 2011 Report Share Posted April 8, 2011 (edited) 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 ? Edited April 8, 2011 by KingA Link to comment Share on other sites More sharing options...
jeffman Posted April 8, 2011 Report Share Posted April 8, 2011 Change += to .= Link to comment Share on other sites More sharing options...
Utherr12 Posted April 8, 2011 Author Report 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 Report 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
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now