Jump to content

replace ASCII character with proper HTML tag format


benphelps

Recommended Posts

I need to replace an ASCII character with an HTML tag.

 

This string would be formatted like this:

\x02 String to be inside tag \x02 this should not be in the tag

 

I know i can do this with

str_replace(chr(02), '<htmltag>', $string)

The above would print this

<htmltag> String to be inside tag <htmltag> this should not be in the tag

 

I need it to pring this:

<htmltag> String to be inside tag </htmltag> this should not be in the tag

 

How can I finish the html tag?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.