开发者

Ignore LINE BREAK

开发者 https://www.devze.com 2023-02-19 02:01 出处:网络
I have a code which I开发者_运维百科 extracted from a text file. Every character in the text file have been embedded into array including line breaks. I want to ignore the line breaks. I\'ve tried so

I have a code which I开发者_运维百科 extracted from a text file. Every character in the text file have been embedded into array including line breaks. I want to ignore the line breaks. I've tried so many ways but it fails.

Can you help me? :)


If you mean you have an array of lines ending with \n, you can remove them like so...

$line = rtrim($line, "\n");


Did you try

str_replace("\n", "", $text);

..?

http://ideone.com/rpQCq

0

精彩评论

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