lordshoa Posted May 26, 2009 Share Posted May 26, 2009 I have a scraper I am trying to get code form another site and just get the text from the code. But I seem to have run in to a problem I cannot figure out. The code has random name and a unix time stamp which changes in a div tag and in a li tag so when I ereg_replace I use (.*) but it seems to take to much and not stop or nothing at all. Is there a better way of making the variable code replace able ? random_name unix_time_stamp thanks little sample <li class="class1 status u_RANDOM_NAME" id="status_UNIX_TIME_STAMP"> $htlm[1] = ereg_replace('<li class="class1 status u-.*." id="status_.*." >','',$html[1]); Quote Link to comment https://forums.phpfreaks.com/topic/159703-solved-ereg_replace-help/ Share on other sites More sharing options...
Axeia Posted May 26, 2009 Share Posted May 26, 2009 [^"]* Everything but a quote? (There is a regex forum just above this one btw) Quote Link to comment https://forums.phpfreaks.com/topic/159703-solved-ereg_replace-help/#findComment-842328 Share on other sites More sharing options...
lordshoa Posted May 26, 2009 Author Share Posted May 26, 2009 Thank you worked perfectly. Quote Link to comment https://forums.phpfreaks.com/topic/159703-solved-ereg_replace-help/#findComment-842332 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.