Login   Register  
PHP Classes
elePHPant
Icontem

udate to class

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      Translator Class  >  All threads  >  udate to class  >  (Un) Subscribe thread alerts  
Subject:udate to class
Summary:courrent one was broken
Messages:2
Author:nate
Date:2008-06-02 21:28:19
Update:2008-06-02 21:30:45
 

  1. udate to class   Reply   Report abuse  
Picture of nate
nate
2008-06-02 21:28:19
//I also made en -> es the default for my needs
function translate($expression, $from='en', $to='es')
{
$f = file("http://translate.google.com/translate_t?text=" . urlencode($expression) . "&langpair=$from|$to");
foreach ( $f as $v ) {
if (strstr($v, '<textarea'))
{
$x = strstr($v, '<textarea');
}
}

$arr = explode('</textarea>', $x);
$arr = explode('<td class=almost_half_cell><div id=result_box dir="ltr">', $arr[1]);
$arr = explode('</div></td></tr><tr><td class=submitcell>', $arr[1]);
return $arr[0];
}

  2. Re: udate to class   Reply   Report abuse  
Picture of nate
nate
2008-06-02 21:30:46 - In reply to message 1 from nate
SORRY! typo (Current) one is broken