Thread: Hash Arrays
View Single Post
  #1  
Old 12-05-2009, 08:26 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Hash Arrays

Well I've recently found a liking to Ruby and it's hash arrays. It would be really rad if we had them in GS2. Hash rockets ftw.

Theory usage:

PHP Code:
function onCreated() {
  
temp.noises = {
    
"cat" => "meow",
    
"dog" => "woof",
    
"manbearpig" => "rawr",
    
"algore" => "im super serial guise"
  
};
  
temp.data = {
    :
ip => "127.0.0.1",
    :
port => 8080
  
};
  echo(
temp.noises["cat"]); // would echo "meow"
  
echo(temp.data[:ip]); // would echo "127.0.0.1"

__________________
Quote:
Reply With Quote