Skip to content

Instantly share code, notes, and snippets.

@mateuspontes
mateuspontes / current_weather.php
Created May 2, 2011 17:26
Get current weather using Google API
$xml = simplexml_load_file('http://www.google.com/ig/api?weather=Teresina');
$information = $xml->xpath("/xml_api_reply/weather/current_conditions/condition");
echo $information[0]->attributes();
@mateuspontes
mateuspontes / gist:809397
Created February 3, 2011 12:04 — forked from anonymous/gist:807708
Db PDO #php
<?php
final class Db extends PDO {
public static $_instance = NULL;
public static function getInstance() {
if (NULL === self::$_instance) {
self::$_instance = new self();
}