i am using a nl2br tag...
nl2br($text)
but in text there are somr <img> tags... in output nl2br method convert <img> to special chars...
instead of showing me pictur for img tag it just displays a <img> tag with full source.....
what to do..?
i am using a nl2br tag...
nl2br($text)
but in text there are somr <img> tags... in output nl2br method convert <img> to special chars...
instead of showing me pictur for img tag it just displays a <img> tag with full source.....
what to do..?
nl2br() doesn't do that... are you sure you don't have something like htmlentities() running at another point in your script?
If you view the souce does it say <img ... >?
We'd need to see your code for a more detailed answer.
Actually if you have "new lines"(\n or\r) in your source code i guess this code occur as well because it would write it as
<img <br /> src="" />
but that would display on more than 1 line. So seeing the actual source of the output could help as well as the code.
Corrections to my coding/thoughts welcome.
no i never used the function line htmlentities
yes my out put code is lying here...
Code:<img src='img/smilies/icon_e_biggrin.gif'> <br /> <img src='img/smilies/icon_eek.gif'> <br /> <img src='img/smilies/icon_razz.gif'> <br /> <img src='img/smilies/icon_e_surprised.gif'>ops: <br /> <img src='img/smilies/icon_e_confused.gif'>: <br /> <img src='img/smilies/icon_cry.gif'> <br />
i only used the nl2br function
I have no idea. I've tested
locally and on two different live servers, each time I gotPHP Code:
<?php
$tag = '<img src="test.jpg">'."\n";
echo nl2br($tag);
?>
HTML Code:<img src="test.jpg"><br />
ok.. leave it what nl2br does....
is ther any method to convert such symbols to proper <img > tag?
htmlspecialchars_decode();
I'd try and find what it is being converted though.
Corrections to my coding/thoughts welcome.
absolutely, otherwise, you might not catch it at the right spot; or it could happen again somewhere
Bookmarks