Skip to content

Instantly share code, notes, and snippets.

View dlakatos847's full-sized avatar

David Lakatos dlakatos847

View GitHub Profile
@yoshitsugu
yoshitsugu / to_ruby_hash.php
Created November 6, 2013 08:40
PHPのArrayをRubyのHashに変換。 PHP Array to Ruby Hash
function to_ruby_hash($array){
$result = "{";
foreach($array as $key => $value){
$result .= "\"".$key."\" => ";
if(is_array($value)){
$result .= to_ruby_hash($value).",\n";
}else{
$result .= "\"".$value."\",";
}
}