Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Oct 2005
    Location
    Surrey, England
    Posts
    286
    Thanks
    2
    Thanked 2 Times in 2 Posts

    Selecting a string from a variable

    What im looking to do is to extract the text from a variable such as a database query and search the text to effectively "highlight" a certain line so that i can perform more functions on the single line i highlighted.

    What i mean is like when you use BB code in an input and the database entry says [l i n k] or [/l i n k] with the text to link in the middle. So what im looking for is an effective way of searching my database entry for this string.

    Can anyone help here, im unsure of what to search for. All im looking for is a function to give me the "[l i n k] text text text [/l i n k]" so i can work on the string myself.

    Thanks for your time
    Daniel Warner
    - - - - - - - - - -
    GuitarMart.co.uk - Free Online Classified Advertisement for Guitarists in the United Kingdom. Free Ads with a Free Photo.

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    This sounds like a job for regex, which you can do right inside your MySQL query with the keyword REGEXP, or after the fact in PHP using preg_match() (and other similar functions).


  •  

    Posting Permissions

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