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.
1 06, 2009

implode

By | 2009-10-15T22:42:21+00:00 June 1st, 2009|Categories: PHP, Ruby|Tags: , , , , |Comments Off on implode

The implode function takes and array and forms a string by concatenating the elements in the array.

PHP

$langs = array('python', 'java', 'ruby');
$string = implode(', ', $langs);
echo $string;
// => python, java, ruby

Ruby

puts ['perl', 'python', 'java'].join(', ');
# => python, java, ruby
29 05, 2009

explode

By | 2009-10-15T22:42:12+00:00 May 29th, 2009|Categories: PHP, Ruby|Tags: , , , , , |Comments Off on explode

The explode function takes 2 parameters – the first is the delimiter, and the second is the string to be exploded. It returns an array of strings, each of which is a substring of the original, formed by splitting the original string on boundaries formed by the string delimiter.

PHP

$my_string = 'perl, python, java';
$array = explode(', ', $my_string);
var_dump($a);
/*
Array (
	[0] => perl
	[1] => python
	[2] => java
)
*/

Ruby

my_string = 'perl, python, java';
puts my_string.split(', ');
# => ["perl", "python", "java"]
26 05, 2009

shuffle

By | 2009-05-21T16:29:35+00:00 May 26th, 2009|Categories: PHP, Ruby|Tags: , , , , |Comments Off on shuffle

Randomizes the order of the elements in an array.

PHP

$a = array('a', 'b', 'c', 'd');
shuffle($a);
print_r($a);
/*
Array (
	[0] => d
	[1] => b
	[2] => c
	[3] => a
)
*/

Ruby

a = [ "a", "b", "c", "d" ];
puts a.sort_by{ rand };
# => ["d", "b", "c", "a"]
14 04, 2009

sort

By | 2009-04-23T15:05:50+00:00 April 14th, 2009|Categories: PHP, Ruby|Tags: , , , |Comments Off on sort

Sorts an array with elements arranged from lowest to highest.

PHP

$a = array('a', 'b', 'e', 'g', 'c', 'd');
sort($a);
print_r($a);
/*
Array (
	[0] => a
	[1] => b
	[2] => c
	[3] => d
	[4] => e
	[5] => g
)
*/

Ruby

a = [ "d", "a", "e", "c", "b" ];
puts a.sort;
# => ["a", "b", "c", "d", "e"]
11 04, 2009

count

By | 2009-04-11T15:17:35+00:00 April 11th, 2009|Categories: PHP, Ruby|Tags: , , , |Comments Off on count

Returns the number of elements in an array.

PHP

$a = array('first' => 1, 'second' => 2);
echo count($a);
// => 2

Ruby

my_array = [1, 2];
puts my_array.length;
# => 2