PHP to Ruby
Convert PHP code into Ruby!
-
implode
Posted on June 1st, 2009 No commentsThe 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
Leave a reply


