public static function prepare_attr_value ($text) {
		if (is_array($text)) {
			/** @noinspection ForeachSourceInspection */
			foreach ($text as &$t) {
				$t = static::prepare_attr_value($t);
			}
			return $text;
		}
		return strtr(
			$text,
			[
				'&'  => '&amp;',
				'"'  => '&quot;',
				'\'' => '&apos;',
				'<'  => '&lt;',
				'>'  => '&gt;'
			]
		);
	}
public static function prepare_attr_value ($text) {
		if (is_array($text)) {
			/** @noinspection ForeachSourceInspection */
			foreach ($text as &$t) {
				$t = static::prepare_attr_value($t);
			}
			return $text;
		}
		return strtr(
			$text,
			[
				'&'  => '&amp;',
				'"'  => '&quot;',
				'\'' => '&apos;',
				'<'  => '&lt;',
				'>'  => '&gt;'
			]
		);
	}
public static function prepare_attr_value ( $ text ) { if ( is_array ( $ text ) ) { /** @noinspection ForeachSourceInspection */ foreach ( $ text as & $ t ) { $ t = static :: prepare_attr_value ( $ t ) ; } return $ text ; } return strtr ( $ text , [ '&' => '&amp;' , '"' => '&quot;' , '\'' => '&apos;' , '<' => '&lt;' , '>' => '&gt;' ] ) ; }
Prepare text to be used as value for html attribute value

@param string|string[] $text

@return string|string[]
Prepare text to be used as value for html attribute value