Jump to content

Issue with JSON function


Utherr12

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 ?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...