PHP to Ruby
Convert PHP code into Ruby!
-
echo
Posted on April 17th, 2009 2 commentsOutput one or more strings.
Strictly speaking, echo() is not a function in PHP, it is a language construct.
PHP
echo 'Hello World!'; // => Hello World!
Ruby
print 'Hello World!' # => Hello World!
2 responses to “echo”
-
I think “concat” is actually the real conversion for “echo”.
Please consider the following:
<div class=”">…The converted:
<div class=”">…“puts” and “print” are -if i’m not wrong- for background usage (eg. terminal, logs, file, …)
-
hey my comment went corrupted!
I wanted to add in the two class fields:
[in php]
if($cond) echo ‘myclass’;[in ruby]
concat ‘myclass’ if cond
Leave a reply
-


