Jump to content

Recommended Posts

From a blog entry, php echoes this line to the browser:

 

<Directory /media/Shared/sites/www/subdomains/expyred/>

 

It doesn't show, because HTML tries to parse it, i believe.

Which means i have to convert < into >, etc.

 

However, when typing the blog, i do insert html characters such as <b> and <u>, etc.

 

What is the simplest way I could I make it so any HTML tags get parsed, but non-html tags don't?

 

Do i have to resort to bbcode?

Link to comment
https://forums.phpfreaks.com/topic/172559-solved-parsing-html-tags/
Share on other sites

That would be an idea, or have an array of tags, such as

 

I don't know if this would work, but give it a try

 

$Input = preg_replace('~(<[^bui]+)>~', '>$1>', $Input);

 

But that would still only work for things that are just <b> or <u> or <bbb> or such. BBCode is best really.

 

But that's just me, there's probably a better answer

Hrmmm, instead of a fullout BBCode system, you could have a htmlentities BBCode.

 

 

It would be pretty ghetto, but you could do something like:

 

[htmlentities]<Directory /media/Shared/sites/www/subdomains/expyred/>[/htmlentities]

 

Then server side:

 

 

$str = preg_replace('/\[htmlentities\](.*?)\[\/htmlentities\]/ie', "htmlentities('\1')");

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.