preg_replace what?!

Started by margarett, September 05, 2014, 10:13:15 AM

Previous topic - Next topic

margarett

* margarett should really learn regex one of these days...

So, I've been working in converters and I'm trying to tackle the issues I encounter.

The most recent one involves lists in posts body.
SMF unordered list:
[list]
[li][/li]
[li][/li]
[/list]

Original unordered list:
[ul]
  [li][/li]
  [li][/li]
[/ul]


SMF's ordered list:
[list type=decimal]
[li][/li]
[li][/li]
[/list]

Original ordered list:
[ol]
  [li][/li]
  [li][/li]
[/ol]


Easy, right? The "li's" are the same, I just need to replace the opening and closing "list" tags.

Help? :)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

live627

psst, you could use str_ireplace()

Hj Ahmad Rasyid Hj Ismail


live627

you weren't supposed to, get out :D

* live627 is being a cheeky bastard

margarett

Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Hj Ahmad Rasyid Hj Ismail

[wol]Whispering out loud mode bbc[/wol] ;)

Advertisement: