Jump to content

Recommended Posts

I want to be able to take a string and find out if they used a < b > tag. If that tag is used and the closing tag isn't </ b >. Then it adds it to the string.

 

For ex.

$string = "<b>Hi.";
$add .="</b>";
$newstringafterwouldbe = "<b>Hi.</b>";

 

Just pointing me in the right direction on which function/s to use would be very helpful.

Link to comment
https://forums.phpfreaks.com/topic/83780-find-tags-in-a-string/
Share on other sites

No. The string will be users input and I'm allowing <B><U><I><S> only. What they post gets displayed on the page and I dont want them doing.

 

<B><S>What's up?

 

Without including the closing </B></S>, because in most cases it will mess things up.

Link to comment
https://forums.phpfreaks.com/topic/83780-find-tags-in-a-string/#findComment-426293
Share on other sites

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.