Anyone have a swfobject regex handy?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fris
    Too lazy to set a custom title
    • Aug 2002
    • 55690

    #1

    Anyone have a swfobject regex handy?

    looking to grab just the mp4 url

    Code:
    so.addVariable('file','http://media.domain.com/videos/filename.mp4');
    Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.
  • AutumnBH
    Confirmed User
    • Oct 2012
    • 298

    #2
    Assuming you want php and your html is in $html:

    Code:
    <?php
    
    $html = "so.addVariable('file','http://media.domain.com/videos/filename.mp4');";
    
    preg_match("/so.addVariable\('file','([^']*)'\);/", $html, $regs);
    
    $mp4_url = $regs[1];
    
    echo "$mp4_url\n";
    
    ?>
    Last edited by AutumnBH; 12-21-2012, 11:28 AM. Reason: double quotes whoops

    Comment

    • woj
      <&(©¿©)&>
      • Jul 2002
      • 47882

      #3
      wait a min, so all the tips you were posting before weren't your own? you were just reposting them?
      Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000
      Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager
      Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager

      Comment

      • fris
        Too lazy to set a custom title
        • Aug 2002
        • 55690

        #4
        Originally posted by woj
        wait a min, so all the tips you were posting before weren't your own? you were just reposting them?
        yes they were ;)

        was looking for saving of work, i ended up doing a simple http url regex which works.
        Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.

        Comment

        Working...