Archive for July, 2008
Merging objects in php
I swear, stdClass in php are just associative arrays without builtin functions to do this crap.
$foo1 = new stdClass();
$foo2 = new stdClass();
$foo3 = new stdClass();
$foo1->one = “1″;
$foo2->two = “2″;
foreach ( $foo1 as $key => $value ) {
$foo3->$key = $value;
}
foreach ( $foo2 as $key => $value ) {
$foo3->$key = $value;
}
var_dump($foo3);
No commentsMoved to Slicehost
Giving up on dreamhost, tired of the slow page loads, overloaded databases, etc.
Trying out slicehost for the next few months, seems ok so far since it gives me a playground for my other more interesting things involving java that I want to play with.
No comments