SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot XandroZ's Avatar
    Join Date
    May 2006
    Posts
    147
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Remove string + 2 characters

    I need to remove, replace from a string, another string plus two characters, that are variables

    Example

    Home>> Blog>> Test
    Home:: Blog::Test

    Need to remain Home>>Test and Home:Test, but :,>>) can be any character

    str_replace('Blog', '',$breadcrumbs) it works, but I want blog plus next 2 characters

  2. #2
    @php.net Salathe's Avatar
    Join Date
    Dec 2004
    Location
    Edinburgh
    Posts
    1,397
    Mentioned
    65 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by XandroZ View Post
    (::,>>) can be any character
    Can the :: or >> really be any character? Something like this would be fairly simply using a regular expression, have you ever used those?
    Salathe
    Software Developer and PHP Manual Author.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •