llms_shuffle_assoc( array $array )

Shuffles an array while keeping the array indices


Parameters Parameters

$array

(array) (Required)


Top ↑

Return Return

(bool)


Top ↑

Source Source

File: includes/llms.template.functions.php

function llms_shuffle_assoc( &$array ) {
	$keys = array_keys( $array );

	shuffle( $keys );

	foreach ( $keys as $key ) {
		$new[ $key ] = $array[ $key ];
	}

	$array = $new;

	return true;
}

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.