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

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.