PHP to Ruby
Convert PHP code into Ruby!
-
Numeric Array
Posted on September 25th, 2009 No commentsNumeric Array
-
Multidimensional Array
Posted on September 24th, 2009 No commentsMultidimensional Array
-
Associative Array
Posted on September 22nd, 2009 No commentsAssociative Array
-
PHP Array
Posted on September 20th, 2009 No commentsA PHP array can be thought of as a variable which can store multiple other variables. Every item in a PHP array is known as an element and is composed of a key and a value. There are 2 main types of PHP arrays:
- Numeric Array
- Associative Array
Each of these can in turn be a Multidimensional Array.
Example Numeric Array:
$terms = array('array', 'element', 'key', 'value'); var_dump($terms); /* => Array ( [0] => array [1] => element [2] => key [3] => value ) */
Example Associative Array:
$terms = array( 'term1' => 'array', 'term2' => 'element', 'term3' => 'key', 'term4' => 'value' ); var_dump($terms); /* => Array ( [term1] => array [term2] => element [term3] => key [term4] => value ) */
Find out more information about PHP’s Numeric Array, Associative Array or Multidimensional Array.


