range

The range() function creates an array containing a range of elements in PHP, however in Ruby the Range object is used to handle ranges of integers or strings.

PHP

$chars = range('a', 'c');
print_r($chars);
// => array(0 => 'a', 1 => 'b', 2 => 'c')

Ruby

chars = 'a'..'c'
chars.each {|item| print "#{item}, " } 
# => a, b, c,
By | 2009-08-10T08:45:56+00:00 July 26th, 2009|Categories: PHP, Ruby|Tags: , |Comments Off on range

About the Author:

This Is A Custom Widget

This Sliding Bar can be switched on or off in theme options, and can take any widget you throw at it or even fill it with your custom HTML Code. Its perfect for grabbing the attention of your viewers. Choose between 1, 2, 3 or 4 columns, set the background color, widget divider color, activate transparency, a top border or fully disable it on desktop and mobile.

This Is A Custom Widget

This Sliding Bar can be switched on or off in theme options, and can take any widget you throw at it or even fill it with your custom HTML Code. Its perfect for grabbing the attention of your viewers. Choose between 1, 2, 3 or 4 columns, set the background color, widget divider color, activate transparency, a top border or fully disable it on desktop and mobile.