• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

RESOLVED solved php snippet: Editor will replace HTML entities with character

wope

New member
Messages
2
Likes
0
Points
1
#1
I need same special characters e.g.   < and so on. The editor change this with the character. I generate some HTML-text with tags, and in this case, this will produce errors in the browser.
example:
echo '<div style="color:green;">neue Seite -&lt; ' .$st. ' erstellen </div><br>';
is automaticly changed to
echo '<div style="color:green;">neue Seite ->' .$st. ' erstellen </div><br>';
 

Temyk

Support team
Staff member
Messages
421
Likes
22
Points
18
#2
Hello.

Now I tried to add this line to the snippet, and it is displayed normally, without errors. Please check. The browser normally perceives the > inside the tag.

If this is important to you, then you can write like this
PHP:
echo '<div style="color:green;">neue Seite -'.htmlspecialchars('<') .$st. ' erstellen </div><br>';
 

wope

New member
Messages
2
Likes
0
Points
1
#3
thank you, I found another solution.
$gt = '&' . 'lt' . ';';
$nbsp = '&' . 'nbsp' . ';';
and so on