开发者

php-language-api and html text problem

开发者 https://www.devze.com 2023-01-08 02:14 出处:网络
i wa开发者_开发百科nt to use this php-language-api i think it is great but with text only it can not wrok with html text

i wa开发者_开发百科nt to use this php-language-api i think it is great but with text only it can not wrok with html text see

$text = htmlspecialchars('<a href="test.php">test.php</a>');
$str = Google_Translate_API::translate($text, 'en', 'ar');

or

$text = '<a href="test.php">test.php</a>';
$str = Google_Translate_API::translate($text, 'en', 'ar');

in the two cases its not work good


have you tried:

$text = '<a href="test.php">test.php</a>';
$str = Google_Translate_API::translate(strip_tags($text), 'en', 'ar');
0

精彩评论

暂无评论...
验证码 换一张
取 消