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
    New to the CF scene
    Join Date
    Nov 2007
    Posts
    1
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Help preg_match()

    Code:
    <asx version = "3.0">
    <entry>
    		<title>Test 123 test</title>
    		<ref HREF="link" />
    </entry>
    My code:

    PHP Code:
        preg_match('/<asx version = "3.0">\n\r\<entry>\n\r\<title>(.*?)<\/title>\n\r\<ref HREF="(.*?)" \/>\n\r\<\/entry>/',$content,$url); 
    It not work
    Pls help

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    Try adding a multiline flag (m) to you're pattern after the last / but before the closing '. If it still doesn't work, add a \t or \s* before the <title> and <href> lookups to account for the whitespace.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)


  •  

    Posting Permissions

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