Удалите новые строки из строки и замените их одним пустым пространством.Php

Кемеровские программисты php общаются здесь
Гость
Удалите новые строки из строки и замените их одним пустым пространством.

Сообщение Гость »

Код: Выделить всё

$string = "
put returns between paragraphs

for linebreak add 2 spaces at end

";
Want to remove all new lines from string.

I've this regex, it can catch all of them, the problem is I don't know with which function should I use it.

Код: Выделить всё

/\r\n|\r|\n/
should become:

Код: Выделить всё

$string = "put returns between paragraphs for linebreak add 2 spaces at end ";


Источник: https://stackoverflow.com/questions/376 ... mpty-space

Вернуться в «Php»