Jump to content

PHP regular expressions


birdie

Recommended Posts

hi, i need desperate help because i have never done anything like this in php.

My aim is to get rid of html tags from a var.

$var = "<div align=center>hell</div>";

i found out that you could use regular expressions but dont know how to use them.

I found <([A-Z][A-Z0-9]*)\b[^>]*>(.*?)</\1> which should work (probably).

How do i use it exactly in preg_replace or anything else?

Thanks  :)
Link to comment
https://forums.phpfreaks.com/topic/19268-php-regular-expressions/
Share on other sites

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.