preg_replace knowledge ? help!

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

    preg_replace knowledge ? help!

    Ok so i've got an advanced grabber script and i try to extract direct download link the main problem / question is if it's possible to include an function in a preg replace per modifier like in the example given bellow

    PHP Code:
    //$grabncopy=site  main source

    $grabncopy=preg_replace('/href="(.*).html"/mi''href=".get_audio('\\1')."'$grabncopy);

    echo 
    $grabncopy
    the modifier should display http://direct_link_name of course without .html extension that will be aded in get_audio function..
    i know this ain't gonna work because i already try it the function will get \1 instead static url.html that the modifier should produce .. the modifier inside the function would not execute ...

    More precisely i want to display direct download link with a function that will extract direct download link from the static url/html page and not doing an grabber with two pages one that list and one that would display the download link ... know how to fix it ? please reply ... tnx
    Last edited by just_m3.; 26.06.11, 08:13.
    This is ten percent luck, twenty percent skill
    Fifteen percent concentrated power of will
    Five percent pleasure, fifty percent pain

    And a hundred percent reason to remember the name!

    #2
    I dont understand what you want , but preg_replace return an array , so will be something like $grabcopy[1]

    PHP Code:

    //$pagecontent= bla bla
    preg_match('#href="(.*?).html"#',$pagecontent,$link);
    $directlink $link[1];

    echo 
    get_audio($directlink
    Unamos los corazones,hoy todos somos multicolores!

    Comment


      #3
      so simple ) yeah i didn't thinked at that .. that's exactly what i want thanx for the tip ;) didn't cross my mind

      i will modify the code and extract it as you said..
      This is ten percent luck, twenty percent skill
      Fifteen percent concentrated power of will
      Five percent pleasure, fifty percent pain

      And a hundred percent reason to remember the name!

      Comment

      Working...
      X