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.

in_array

The in_array() function in PHP checks if a value exists in an array – returning true if it does, or false otherwise.

The last argument in this function forces a strict type check of the value in PHP. Since Ruby does not consider a Fixnum of 1 and a String of ‘1’ to be the same – it always operates as if the last argument were set to true.

PHP

$my_array = array('a', 'b', 'c', 'd');
if('a', in_array($a), true) {
	echo 'Found it in the array';
}
// => Found it in the array

Ruby

my_array = [ "a", "b", "c", "d" ];
if( my_array.include?('a') ) {
	 puts 'Found it in the array';
}
# => Found it in the array
By | 2009-10-14T13:03:32+00:00 September 28th, 2009|Categories: PHP, Ruby|Tags: , , , |Comments Off on in_array

About the Author: