godfather Posted August 20, 2006 Share Posted August 20, 2006 Well, Does anyone have script in preg_match_all-function that works. I have tried his one.[code]<?php$url = "http://www.svenskaspel.se/pl.aspx?PageID=281&menuid=3&parentid=4377"; $stryk = file_get_contents($url); # find <p class="text" och "<br \>" and erase them...$change = array('', '<td class="lwb">', '<tr class=sbr', '');$to_this = array('<table>','<tr>', '<td>', '</td>', '</tr>', '</table>'); $stryklink = str_replace($change, $to_this, $stryk); # Find all links in $stryklinkpreg_match_all("/\<a href\=\".*\"\>(.*)/", $stryklink, $matches); foreach($matches[0] as $rows => $link);?>[/code]And this is the page code that I want to shown on my page[code]<td width=35> </td> <td width=350 valign=top><br> <br><BR><TABLE WIDTH='350' CELLPADDING='2' BORDER='0' CELLSPACING='0' BGCOLOR='#0A235A'> <TR> <TD width='160' class='lwb'> <TABLE width='100%'> <TR> <TD nowrap='true' width='100%' class='lwb'>Veckans omgång (v.32)</TD> </TR> </TABLE> </TD> <TD class='lwb'> <TABLE> <TR> <TD class='swb'>Spelstopp 12/8 15:55</TD> </TR> <TR> <TD class='swr'>Klicka på en match för att få fram matchfakta.</TD> </TR> </TABLE> </TD> </TR> </TABLE> <TABLE WIDTH='350' CELLPADDING='6' BORDER='0' CELLSPACING='0'> <TR NOWRAP='true' BGCOLOR='#cc0000'> <TD CLASS='mwb' COLSPAN='2'>MATCH</TD> <TD ALIGN='CENTER' NOWRAP='true' CLASS='swb'>SVENSKA FOLKET</TD> </TR> <TR BGCOLOR='#FFFFFF'> <TD class='sbr' align='right' valign='top' style='color:red'>1</TD> <TD class='sbr' width='60% valign='top' style='color:red'><IMG SRC='/img/pil.gif' WIDTH='10' HEIGHT='11'/> <a href='pl.aspx?PageID=1169&menuid=3&prod=stryk&omg=3932&parentid=4377&match=120025&matchVal=1' style='color:red'>Helsingborg - Djurgården <img src='/img/13plus_logga_liten.gif' border='0' align='absbottom'/> <br><i>Canal+ Sport 13/8 kl. 18:00</i><br></TD> <TD class='sbr' align='center' valign='top' nowrap style='color:red'>46% 28% 26% </TD> </TR> <TR BGCOLOR='#E3E3E3'> <TD class='sbr' align='right' valign='top' style='color:black'>2</TD> <TD class='sbr' width='60% valign='top' style='color:black'><IMG SRC='/img/pil.gif' WIDTH='10' HEIGHT='11'/> <a href='pl.aspx?PageID=1169&menuid=3&prod=stryk&omg=3932&parentid=4377&match=120023&matchVal=2' style='color:black'>Gefle - IFK Göteborg</TD> <TD class='sbr' align='center' valign='top' nowrap style='color:black'>26% 23% 51% </TD> </TR> <TR BGCOLOR='#FFFFFF'> <TD class='sbr' align='right' valign='top' style='color:black'>3</TD> <TD class='sbr' width='60% valign='top' style='color:black'><IMG SRC='/img/pil.gif' WIDTH='10' HEIGHT='11'/> <a href='pl.aspx?PageID=1169&menuid=3&prod=stryk&omg=3932&parentid=4377&match=120024&matchVal=3' style='color:black'>Halmstad - Öster</TD> <TD class='sbr' align='center' valign='top' nowrap style='color:black'>54% 24% 22% </TD> </TR> <TR BGCOLOR='#E3E3E3'> <TD class='sbr' align='right' valign='top' style='color:black'>4</TD> <TD class='sbr' width='60% valign='top' style='color:black'><IMG SRC='/img/pil.gif' WIDTH='10' HEIGHT='11'/> <a href='pl.aspx?PageID=1169&menuid=3&prod=stryk&omg=3932&parentid=4377&match=120021&matchVal=4' style='color:black'>Hammarby - Örgryte</TD> <TD class='sbr' align='center' valign='top' nowrap style='color:black'>68% 17% 15% </TD> </TR> <TR BGCOLOR='#FFFFFF'> <TD class='sbr' align='right' valign='top' style='color:black'>5</TD> <TD class='sbr' width='60% valign='top' style='color:black'><IMG SRC='/img/pil.gif' WIDTH='10' HEIGHT='11'/> <a href='pl.aspx?PageID=1169&menuid=3&prod=stryk&omg=3932&parentid=4377&match=120022&matchVal=5' style='color:black'>Kalmar FF - AIK</TD> <TD class='sbr' align='center' valign='top' nowrap style='color:black'>36% 32% 32% </TD> </TR> <TR BGCOLOR='#E3E3E3'> <TD class='sbr' align='right' valign='top' style='color:black'>6</TD> <TD class='sbr' width='60% valign='top' style='color:black'><IMG SRC='/img/pil.gif' WIDTH='10' HEIGHT='11'/> <a href='pl.aspx?PageID=1169&menuid=3&prod=stryk&omg=3932&parentid=4377&match=120026&matchVal=6' style='color:black'>Malmö FF - Elfsborg</TD> <TD class='sbr' align='center' valign='top' nowrap style='color:black'>45% 28% 27% </TD> </TR> <TR BGCOLOR='#FFFFFF'> <TD class='sbr' align='right' valign='top' style='color:black'>7</TD> <TD class='sbr' width='60% valign='top' style='color:black'><IMG SRC='/img/pil.gif' WIDTH='10' HEIGHT='11'/> <a href='pl.aspx?PageID=1169&menuid=3&prod=stryk&omg=3932&parentid=4377&match=116357&matchVal=7' style='color:black'>Brommapojkarna - Mjällby</TD> <TD class='sbr' align='center' valign='top' nowrap style='color:black'>68% 17% 15% </TD> </TR> <TR BGCOLOR='#E3E3E3'> <TD class='sbr' align='right' valign='top' style='color:black'>8</TD> <TD class='sbr' width='60% valign='top' style='color:black'><IMG SRC='/img/pil.gif' WIDTH='10' HEIGHT='11'/> <a href='pl.aspx?PageID=1169&menuid=3&prod=stryk&omg=3932&parentid=4377&match=116356&matchVal=8' style='color:black'>Ljungskile - Umeå FC</TD> <TD class='sbr' align='center' valign='top' nowrap style='color:black'>52% 25% 23% </TD> </TR> <TR BGCOLOR='#FFFFFF'> <TD class='sbr' align='right' valign='top' style='color:black'>9</TD> <TD class='sbr' width='60% valign='top' style='color:black'><IMG SRC='/img/pil.gif' WIDTH='10' HEIGHT='11'/> <a href='pl.aspx?PageID=1169&menuid=3&prod=stryk&omg=3932&parentid=4377&match=116360&matchVal=9' style='color:black'>IFK Norrköping - Landskrona</TD> <TD class='sbr' align='center' valign='top' nowrap style='color:black'>43% 30% 27% </TD> </TR> <TR BGCOLOR='#E3E3E3'> <TD class='sbr' align='right' valign='top' style='color:black'>10</TD> <TD class='sbr' width='60% valign='top' style='color:black'><IMG SRC='/img/pil.gif' WIDTH='10' HEIGHT='11'/> <a href='pl.aspx?PageID=1169&menuid=3&prod=stryk&omg=3932&parentid=4377&match=116358&matchVal=10' style='color:black'>Qviding - Jönköpings Södra</TD> <TD class='sbr' align='center' valign='top' nowrap style='color:black'>44% 29% 27% </TD> </TR> <TR BGCOLOR='#FFFFFF'> <TD class='sbr' align='right' valign='top' style='color:black'>11</TD> <TD class='sbr' width='60% valign='top' style='color:black'><IMG SRC='/img/pil.gif' WIDTH='10' HEIGHT='11'/> <a href='pl.aspx?PageID=1169&menuid=3&prod=stryk&omg=3932&parentid=4377&match=116361&matchVal=11' style='color:black'>Trelleborg - Assyriska <br><i>SPORT-Expressen 14/8 kl. 19:00</i><br></TD> <TD class='sbr' align='center' valign='top' nowrap style='color:black'>63% 20% 17% </TD> </TR> <TR BGCOLOR='#E3E3E3'> <TD class='sbr' align='right' valign='top' style='color:black'>12</TD> <TD class='sbr' width='60% valign='top' style='color:black'><IMG SRC='/img/pil.gif' WIDTH='10' HEIGHT='11'/> <a href='pl.aspx?PageID=1169&menuid=3&prod=stryk&omg=3932&parentid=4377&match=116355&matchVal=12' style='color:black'>Väsby United - Falkenberg</TD> <TD class='sbr' align='center' valign='top' nowrap style='color:black'>44% 29% 27% </TD> </TR> <TR BGCOLOR='#FFFFFF'> <TD class='sbr' align='right' valign='top' style='color:black'>13</TD> <TD class='sbr' width='60% valign='top' style='color:black'><IMG SRC='/img/pil.gif' WIDTH='10' HEIGHT='11'/> <a href='pl.aspx?PageID=1169&menuid=3&prod=stryk&omg=3932&parentid=4377&match=116359&matchVal=13' style='color:black'>Örebro - GIF Sundsvall</TD> <TD class='sbr' align='center' valign='top' nowrap style='color:black'>63% 21% 16% </TD> </TR> </TABLE> <br/></td> <td width=35> </td> <td width=185 valign=top><br/></td></tr></table>[/code]Somebody know what I'm doing wrong?Or do you have a better script. My output is a blank white page men execute this code on my server >:(Thanx for y'all help. Quote Link to comment https://forums.phpfreaks.com/topic/18096-does-anyone-have-a-script-that-works/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.