How to remove  in a PHP string

后端 未结 7 2109
太阳男子
太阳男子 2021-01-14 07:36

I am trying to use the Microsoft Bing API.

$data = file_get_contents(\"http://api.microsofttranslator.com/V2/Ajax.svc/Speak?appId=APPID&text={$text}&         


        
7条回答
  •  孤独总比滥情好
    2021-01-14 08:02

    You could use substr to only get the rest without the UTF-8 BOM:

    // if it’s binary UTF-8
    $data = substr($data, 3);
    // if it’s percent-encoded UTF-8
    $data = substr($data, 9);
    

提交回复
热议问题