开发者

How to remove unwanted characters

I am usi开发者_高级运维ng cakephp 1.2. I am using httpsocket get method. It works well. But the content is enclosed by quotes..

string(123) "..this is where the content is".

I think it is telling the type of response and the number of characters of the output. I have my application in production setup.

How can i remove it.

I appreciate any help.

Thanks.


It sounds like a var_dump is being done on the other end.

Either or, this should pull out the text.

preg_match('~"(.*)"~s', $string, $matches);

if (!empty($matches)) {
    $returned  = $matches[1];
}

echo $returned; 

Hopefully my regex isn't horrible.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜