array( * 'a1' => array( * 'a1a' => 'hi!' * ) * ), * 'b' * )); * * echo $object->a->a1->a1a //=> hi! * * returns a multi-dimensional object */ static function objectify($array) { if (is_array($array)) { return (object) array_map(array(__CLASS__, __FUNCTION__), $array); } else { return $array; } } /* * Generates a unique identifier by combining a prefix and an autoincremental integer * * prefix - a string to be prepended to the numeric id (optional). * * returns the unique identifer string. * */ static function unique_id($prefix='id_') { static $id; $id = isset($id) ? $id + 1 : 0; return "{$prefix}{$id}"; } /* * Gets the current page URL. * * * Returns a URL string. * */ static function current_url() { return 'http://' . preg_replace('/\/$/', '', $_SERVER['HTTP_HOST']) . $_SERVER['REQUEST_URI']; } } ?>