WordPress at a glance

wp_parse_list() WP 1.0

Cleans up an array, comma- or space-separated list of scalar values.

Is the basis for: wp_parse_id_list()
✈ 1 time = 0.000001s = speed of light | 50000 times = 0.04s = speed of light | PHP 7.2.16, WP 5.1.1

No Hooks.

Return

Array. Sanitized array of values.

Usage

wp_parse_list( $list );
$list(array/string) (required)
List of values.

Code of wp parse list: wp-includes/functions.php WP 5.2.2

<?php
function wp_parse_list( $list ) {
	if ( ! is_array( $list ) ) {
		return preg_split( '/[\s,]+/', $list, -1, PREG_SPLIT_NO_EMPTY );
	}

	return $list;
}

Related Functions

From category: Helper Functions

No comments
    Hello, !     Log In . Register