Remove newlines from string in PHP

PHP | remove newline

Examples:
Input: Hello welcome to engineerforengineer. Output: Hello welcome to engineerforengineer. Remove the new line between Hello and engineerforengineer. Input: I love engineerforengineer Output: I love engineerforengineer 
The idea is to use str_replace () $text = "Hello welcome to engineerforengineer" ; echo $text ; echo " " ; $text = str_replace ( "" , " " , $text ); echo $text ; ?>



Remove newlines from string in PHP: StackOverflow Questions

Get Solution for free from DataCamp guru