jHtmlArea href link corrupted on echo?

170 Views Asked by At

I have a jHtmlArea as a text input for a web displayed output unfortunately any images or links that are put into the text area are corrupted with a \ before the quotation mark, when echo'd on the output page.

Is there ant way to code this differently?

Input

$text = preg_replace("/\r\n/", '', $_POST[$textIndex]) . PHP_EOL;

echo is

<?php if ($text) : // text ?>
<div><?php echo $text; ?></div>
1

There are 1 best solutions below

0
On

Found the answer. It's really simple. Just change output to echo stripslashes($text)