Need Help Related To Preg match

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

    Need Help Related To Preg match

    Whats Wrong Here
    Code:
    <?php
    $m="http://gamezmob.com/dispLoad.php?id=788";
    
    $from=file_get_contents("$m");
    
    preg_match('|<a href="dispGet.php?id=788" class="download">Download</a></td></tr></tbody></table><br>(.*?)<br><form name="form1" method="post" action="">|',from,$regs);
    
    echo $regs[1];
    ?>
    I Need To Grab Comment From Gamezmob download page But It Out Nothing

    any1 pls Help me to Fix it

    #2
    Try to change this:

    PHP Code:
    $from=file_get_contents($m); 
    and add $ here

    PHP Code:
    preg_match('|<a href="dispGet.php?id=788" class="download">Download</a></td></tr></tbody></table><br>(.*?)<br><form name="form1" method="post" action="">|',$from,$regs); 
    <!DOCTYPE html PUBLIC "-//WAPFORUM.RS

    Comment


      #3
      Ohh i did Mistake in posting my Code here added

      i have added $ in Front of from my Original code
      Still Nothing Is output When i m using preg_match_all It Output jst a word Array
      Last edited by shushant; 10.01.12, 16:27.

      Comment


        #4
        If the rest of matching pattern is ok, change to this: echo $regs[0];
        <!DOCTYPE html PUBLIC "-//WAPFORUM.RS

        Comment


          #5
          PHP Code:
          <?php
          $m
          ="http://gamezmob.com/dispLoad.php?id=750";

          $from=file_get_contents($m);

          $from=preg_match_all('#</td></tr></tbody></table><br/>(?P<info>.+?)<br/>#sim',$from,$comments);
          echo 
          $comments['info'][0];
          //print_r($from);
          ?>
          here try this :p
          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


            #6
            Thanx u arange and just_m3. Bro Thanx A Lot

            Comment


              #7
              PHP Code:
              $from='dfgdgdgdsg sfdgsdrfr g <a href="dispGet.php?id=788" class="download">Download</a></td></tr></tbody></table><br>findme<br><form name="form1" method="post" action=""> sfgsfsdf sdf fs';

              preg_match('/<a href=\"dispGet.php\?id=788\" class=\"download\">Download<\/a><\/td><\/tr><\/tbody><\/table><br>(.*?)<br><form name=\"form1\" method=\"post\" action=\"\">/i',$from,$regs); 

              echo 
              $regs[1]; 
              $regs[1] echoes findme here.
              Last edited by arnage; 11.01.12, 10:53.
              <!DOCTYPE html PUBLIC "-//WAPFORUM.RS

              Comment

              Working...
              X