Automattic\WooCommerce\Utilities
ArrayUtil::unique_truthy_values
Get the unique truthy values of an array, reindexed.
Метод класса: ArrayUtil{}
Хуков нет.
Возвращает
array. The unique truthy values, with sequential integer keys.
Использование
$result = ArrayUtil::unique_truthy_values( $items ): array;
- $items(массив) (обязательный)
- The array to process.
Список изменений
| С версии 11.3.0 | Введена. |
Код ArrayUtil::unique_truthy_values() ArrayUtil::unique truthy values WC 11.3.0
public static function unique_truthy_values( array $items ): array {
return array_values( array_unique( array_filter( $items ) ) );
}