Need Help Related To Preg match

Started on the old forum in January 2012 · view the original in the archive · old links redirect here

6 replies · 496 views · started 14 years ago · 1 min read

3 participants
shushant Developer · 207 posts #1

Whats Wrong Here

<?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

arnage Lead · 811 posts #2

Try to change this:

$from=file_get_contents($m);

and add $ here

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***
shushant Developer · 207 posts #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

arnage Lead · 811 posts #4

If the rest of matching pattern is ok, change to this: echo $regs[0];

<!DOCTYPE html PUBLIC "-//***WAPFORUM**.**RS***
just_m3. Developer · 199 posts #5
<?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 😛

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!

shushant Developer · 207 posts #6

Thanx u arange and just_m3. Bro Thanx A Lot 🙂

arnage Lead · 811 posts #7
$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. 🙂

<!DOCTYPE html PUBLIC "-//***WAPFORUM**.**RS***

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close