Jump to content

Issue with JSON function


Recommended Posts

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 by KingA
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...