php remove newline from string

You can remove new line character any where in string using regex preg_replace.preg_replace is function which work on regex to search and replace in string.Regular express is strong part of php.You can also search replace html tags.Here I have used regex string feature to search and replace new line character. Here is example how you can remove new line anywhere

Read more