Skip to content

Instantly share code, notes, and snippets.

@wtnabe
Created July 8, 2011 05:07
Show Gist options
  • Save wtnabe/1071184 to your computer and use it in GitHub Desktop.
Save wtnabe/1071184 to your computer and use it in GitHub Desktop.
Translate from your Ruby object to PHP literal
class Object
def to_php
self.inspect.gsub( /[\[{]/, 'array(' ).gsub( /[}\]]/, ')' )
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment