I want to extract string between html tags and convert it into other language using google api and to append the string with html tags.
For example,
<b>This is an example</b>
I want to extract the string “This is an example” and convert it into other language and then again append the string with bold tag.
Could anyone know how to proceed with this?
Regards
Rekha
Here’s a working example of using the Google API to translate server side. The function takes a string as an input and strips HTML tags from it before translating.
The languages are passed in as arguments.
When you run the code above, you should add in a proper self identification to the header.
References:
Google Translation API section for Flash and Non-Javascript Interfaces
PHP cUrl examples
json_decode()
strip_tags()