Joe_Dean Posted February 11, 2009 Share Posted February 11, 2009 I'm trying to include this into a webpage, but customize it to my liking: http://doerfler.gtamp.de/monitor/index2.php?ip=85.17.200.135&port=4800&ss=s&c=grey How do I remove everything ABOVE the player count? I'd even settle for something that would replace it with a space if it cannot be 'stripped' out. Quote Link to comment https://forums.phpfreaks.com/topic/144846-replacedelete-text-php-noob/ Share on other sites More sharing options...
The Little Guy Posted February 11, 2009 Share Posted February 11, 2009 We would need to see some code Quote Link to comment https://forums.phpfreaks.com/topic/144846-replacedelete-text-php-noob/#findComment-760078 Share on other sites More sharing options...
drisate Posted February 12, 2009 Share Posted February 12, 2009 Load the page into a var like this $content = file_get_contents('http://doerfler.gtamp.de/monitor/index2.php?ip=85.17.200.135&port=4800&ss=s&c=grey'); Then use some regex to get the stuff you need Quote Link to comment https://forums.phpfreaks.com/topic/144846-replacedelete-text-php-noob/#findComment-760090 Share on other sites More sharing options...
Joe_Dean Posted February 12, 2009 Author Share Posted February 12, 2009 Thanks for the reply, but I'm completely new to PHP. All I know how to do is use the include statement. Quote Link to comment https://forums.phpfreaks.com/topic/144846-replacedelete-text-php-noob/#findComment-760098 Share on other sites More sharing options...
drisate Posted February 12, 2009 Share Posted February 12, 2009 I am not to good with regex coding ... but you should give it a try and ask in the Regex board. I am sur there's a guru that will respond in less then 24h. Regex board: http://www.phpfreaks.com/forums/index.php/board,43.0.html Quote Link to comment https://forums.phpfreaks.com/topic/144846-replacedelete-text-php-noob/#findComment-760106 Share on other sites More sharing options...
premiso Posted February 12, 2009 Share Posted February 12, 2009 <?php $content = file_get_contents('http://doerfler.gtamp.de/monitor/index2.php?ip=85.17.200.135&port=4800&ss=s&c=grey'); preg_match('~<td valign="top">P(.+?)</td>~s', $content, $matches); print $matches[0]; die(); ?> Should print: <td valign="top">Players</td><td valign="top">0/20</td></tr> preg_match Quote Link to comment https://forums.phpfreaks.com/topic/144846-replacedelete-text-php-noob/#findComment-760143 Share on other sites More sharing options...
drisate Posted February 12, 2009 Share Posted February 12, 2009 Your tha man premiso ;-) Quote Link to comment https://forums.phpfreaks.com/topic/144846-replacedelete-text-php-noob/#findComment-760153 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.