daniel <offstuff / aon.at> wrote:
> $arr = Array();
> for( $i=0; $i<10; $i++ )
> {
>   $arr[$i]["name"] = "daniel";
>   $arr[$i]["age"] = 20;
> }
> 
> This was php.
> How to do this in ruby?

arr = (0...10).map { {"name" => "daniel", "age" => 20} }

or, more explicitly and in two steps

arr = (0...10).map {Hash.new}
arr.each {|i| i["name"] = "daniel"; i["age"] = 20}

martin