Home 2017-05-30T16:12:47+00:00

Convert PHP code into Ruby!

Find out how to change PHP code into Ruby code using PHP to Ruby as your converter. We are on a quest to provide a conversion resource for PHP developers looking to migrate their code to Ruby. Every standard PHP function will be ported to show how it can be done in Ruby. If you find a PHP function which has not been converted yet, feel free to help us out by submitting conversion code yourself.

410, 2009

array_values

By | October 4th, 2009|Categories: PHP, Ruby|Tags: , , , |Comments Off on array_values

The array_values() function in PHP takes an array and returns all it’s values as a numeric array.

PHP

$array = array('go' => 'green', 'stop' => 'red');
var_dump( array_values($array) );
/*
Array (
	[0] => green
	[1] => red
)
*/

To replicate this functionality in Ruby, we need to use a Hash object, since arrays […]

110, 2009

list

By | October 1st, 2009|Categories: PHP, Ruby|Tags: , , , , , , |Comments Off on list

The list() function in PHP is used to assign multiple variables as if they were an array. Technically, list() is not a function in PHP, it is a language construct.

Ruby has no real need for a function such as list(), as the same can be achieve using parallel assignment – […]

2809, 2009

in_array

By | September 28th, 2009|Categories: PHP, Ruby|Tags: , , , |Comments Off on 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 […]

Autonomous Standing Desk

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.