private function normaliseKeys ($obj) {
		// Determine is working with a class or araay
		if ($obj instanceof stdClass) {
			$new_obj = new stdClass();
			$is_obj = true;
		} else {
			$new_obj = array();
			$is_obj = false;
		}


		foreach($obj as $key => $val){
			// If we come across another class/array, normalise it
			if ($val instanceof stdClass || is_array($val)) {
				$val = $this->normaliseKeys($val);
			}
			
			// Replace any unwanted characters in they key name
			if ($is_obj) {
				$new_obj->{str_replace('-', '', $key)} = $val;
			} else {
				$new_obj[str_replace('-', '', $key)] = $val;
			}
		}

		return $new_obj;
	}
private function normaliseKeys ($obj) {
		// Determine is working with a class or araay
		if ($obj instanceof stdClass) {
			$new_obj = new stdClass();
			$is_obj = true;
		} else {
			$new_obj = array();
			$is_obj = false;
		}


		foreach($obj as $key => $val){
			// If we come across another class/array, normalise it
			if ($val instanceof stdClass || is_array($val)) {
				$val = $this->normaliseKeys($val);
			}
			
			// Replace any unwanted characters in they key name
			if ($is_obj) {
				$new_obj->{str_replace('-', '', $key)} = $val;
			} else {
				$new_obj[str_replace('-', '', $key)] = $val;
			}
		}

		return $new_obj;
	}
private function normaliseKeys ( $ obj ) { // Determine is working with a class or araay
 if ( $ obj instanceof stdClass ) { $ new_obj = new stdClass ( ) ; $ is_obj = true ; } else { $ new_obj = array ( ) ; $ is_obj = false ; } foreach ( $ obj as $ key => $ val ) { // If we come across another class/array, normalise it
 if ( $ val instanceof stdClass || is_array ( $ val ) ) { $ val = $ this -> normaliseKeys ( $ val ) ; } // Replace any unwanted characters in they key name
 if ( $ is_obj ) { $ new_obj -> { str_replace ( '-' , '' , $ key ) } = $ val ; } else { $ new_obj [ str_replace ( '-' , '' , $ key ) ] = $ val ; } } return $ new_obj ; }
Recursively normalise any key names in an object, removing unwanted characters
Recursively normalise any key names in an object removing unwanted characters