Hello

i have a contact form which sends the message as an entire line

i have the following code to combat this problem but not working

$messageBody = $_POST["messageBody"];
$messageBody = str_replace("\r\n", "\n", $messageBody);
$messageBody = str_replace("\n", "\r\n", $messageBody);

anyone have any ideas?

thanks

Hi,

Try the function nl2br().

R.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.