Announcement

Collapse
No announcement yet.

preg_replace help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • preg_replace help

    ok basically i want to cut off numbers in page numbering

    the bottom line of code does as it shud

    the page number isnt a <a href=''> its just like [4]

    each number is seperated by a | hense the "\s\|\s"'s

    why doesnt the top one work?

    it cuts off only the last number for sum reason

    using "U" after the "#" doesnt work

    Code:
    // =======================
     // Cut off excess numbers
     // =======================
     $text = preg_replace('#\]\s\|\s(.*)\s\|\s(.*)#', '] | [url="file://\1"]\\1[/url] | ...', $text);
     $text = preg_replace('#(.*)\s\|\s(.*)\s\|\s(.*)\s\|\s\[#', '... [url="file://\2"]\\2[/url] | [url="file://\3"]\\3[/url] | [', $text);

  • #2
    Er, elaborate a bit more and I think I'll be able to help.
    "63,000 bugs in the code, 63,000 bugs, you get 1 whacked with a service pack, now there's 63,005 bugs in the code."
    "Before you critisize someone, walk a mile in their shoes. That way, when you critisize them, you're a mile away and you have their shoes."
    Utopia Software - Current Software: Utopia News Pro (news management system)

    Comment

    Related Topics

    Collapse

    Working...
    X