PHP-функция: rangeСписок php-функций

javascript:

function range ( low, high, step ) {
	// Создает массив, содержащий диапазон элементов
	// 
	// +   original by: _argos

	var matrix = [];
	var inival, endval, plus;
	var walker = step || 1;
	var chars  = false;

	if ( !isNaN ( low ) && !isNaN ( high ) ) {
		inival = low;
		endval = high;
	} else if ( isNaN ( low ) && isNaN ( high ) ) {
		chars = true;
		inival = low.charCodeAt ( 0 );
		endval = high.charCodeAt ( 0 );
	} else {
		inival = ( isNaN ( low ) ? 0 : low );
		endval = ( isNaN ( high ) ? 0 : high );
	}

	plus = ( ( inival > endval ) ? false : true );
	if ( plus ) {
		while ( inival <= endval ) {
			matrix.push ( ( ( chars ) ? String.fromCharCode ( inival ) : inival ) );
			inival += walker;
		}
	} else {
		while ( inival >= endval ) {
			matrix.push ( ( ( chars ) ? String.fromCharCode ( inival ) : inival ) );
			inival -= walker;
		}
	}

	return matrix;
}

//Примеры:

alert ( 
   range ( 0, 12 ) + '\n'+
   range( 0, 100, 10 ) + '\n'+
   range( 'a', 'i' ) + '\n'+
   range( 'c', 'a' ) );