Ver Mensaje Individual
  #1 (permalink)  
Antiguo 18/11/2013, 14:38
wilsonlazo
 
Fecha de Ingreso: julio-2013
Mensajes: 60
Antigüedad: 10 años, 9 meses
Puntos: 0
Convertir de PEN a USD..

necesito Convertir de PEN a USD para enviar a pypal anteriormente estaba utilizando el:
Código PHP:
$url "http://www.google.com/ig/calculator?hl=en&q=$amount$from_Currency=?$to_Currency"
y me funcionaba a la perfeccion pero a sido deshabilitado.. desde 1 de noviembre.

por eso ahora estoy tratando de parsear con este:
Código PHP:
https://www.google.com/search?q=100+pen+to+usd 
me codigo es este:

Código PHP:
function currency($amount,$ToCurrency,$FromCurrency)
    {
        
$returnHtml = array();
        
$page "http://www.google.com/search?&q=$amount+$ToCurrency+in+$FromCurrency";
        
        
$returnRawHtml file_get_contents$page );
         
curl_setopt ($chCURLOPT_URL$url);    
        
preg_match_all('/<h2 class=r(.*)\<\/h2\>/Uis',$returnRawHtml,$returnHtml,PREG_PATTERN_ORDER);
        
        if (isset(
$returnHtml[0][0])) 
        {
          
$gRate strip_tags($returnHtml[0][0]);
          return 
$gRate;
        }
        else {
            return 
false;
        }

    } 
pero me retorna falso .... he probado hace para saber que eslo q estaba pasando ..
Código PHP:
function currency($amount,$ToCurrency,$FromCurrency)
    {
        
$returnHtml = array();
        
$page "http://www.google.com/search?&q=$amount+$ToCurrency+in+$FromCurrency";
        
        
$returnRawHtml file_get_contents$page );
         
curl_setopt ($chCURLOPT_URL$url);    
        
preg_match_all('/<h2 class=r(.*)\<\/h2\>/Uis',$returnRawHtml,$returnHtml,PREG_PATTERN_ORDER);
        
        return 
$returnRawHtml;

y me imprime este:
Código PHP:
http://www.promovendo.net/sadi/cart.php 
bueno espero su ayuda... o si tiene una funcion que utilizan me seria de gran ayuda...