Implode Explode

To implode or explode

function implode_array($array) {
	if(is_array($array)){
	  foreach($array as $key => $item) {
		  $string .= $seperator."$key*||*$item";
		  $seperator = "%||%";
	  } 
	}	
	return $string;
}



function explode_array($string) {
	  $this_array = explode("%||%",$string); 
      if(is_array($this_array)){
		  foreach($this_array as $item) {
			  $components = explode("*||*",$item); 
			  $new_key   = $components[0];
			  $new_value = $components[1];
			  $new_array[$new_key] = $new_value;
		  } 
	  }
	  return $new_array;
}
Comments