[Regex] preg_replace problem

Discussion in 'PHP' started by adbox, Jun 4, 2010.

  1. #1
    I'd like to rid a text of citations, (wikipedia).

    citations look like this [0] , [11]

    Can you guys help me, im still very new with preg_replace & regex.
     
    adbox, Jun 4, 2010 IP
  2. koko5

    koko5 Active Member

    Messages:
    394
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    70
    #2
    Hi, try this:
    preg_replace('#\[\d+\]#mu','',$string)
    PHP:
    Regards :)
     
    koko5, Jun 4, 2010 IP
  3. adbox

    adbox Well-Known Member

    Messages:
    906
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    155
    Digital Goods:
    1
    #3
    Thank you will check it out asap :)
     
    adbox, Jun 4, 2010 IP