How to get the quote value through the file get contents from the following page: link
How to get the quote value through the file get contents from the following page: link
I made a code here and got the result:
$html = file_get_contents( "https://www.google.com/finance?q=USDBRL&ei=tb1KWOHWLMX_mAGJyLnIBw" );
$content = new DOMDocument();
@$content->loadHTML( $html );
$itens = $content->getElementsByTagName( "span" );
$cotacao = null;
foreach( $itens as $item ) {
if ( stripos( $item->getAttribute( "class"), "pr" ) !== false )
$cotacao = str_replace( "1 USD = ", "", $item->nodeValue );
}
echo trim( $cotacao );