# wordpress-seo/27.8/src/helpers/import-helper.php

Yoast SEO – Advanced SEO with real-time guidance and built-in AI, version 27.8. 32 lines.

- Page: https://pluginprobe.com/plugins/wordpress-seo/27.8/code/src/helpers/import-helper.php
- Raw: https://pluginprobe.com/plugins/wordpress-seo/27.8/raw/src/helpers/import-helper.php
- Modified: 2022-04-05T13:50:02+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wordpress-seo/27.8/code/src/helpers/import-helper.php#L10-L20`.

```php
<?php

namespace Yoast\WP\SEO\Helpers;

/**
 * The Import Helper.
 */
class Import_Helper {

	/**
	 * Flattens a multidimensional array of settings. Recursive.
	 *
	 * @param array  $array_to_flatten The array to be flattened.
	 * @param string $key_prefix       The key to be used as a prefix.
	 *
	 * @return array The flattened array.
	 */
	public function flatten_settings( $array_to_flatten, $key_prefix = '' ) {
		$result = [];
		foreach ( $array_to_flatten as $key => $value ) {
			if ( \is_array( $value ) ) {
				$result = \array_merge( $result, $this->flatten_settings( $value, $key_prefix . '/' . $key ) );
			}
			else {
				$result[ $key_prefix . '/' . $key ] = $value;
			}
		}

		return $result;
	}
}

```
