redknight Posted May 31, 2009 Share Posted May 31, 2009 Hi, data.php = collects the data of visitors saveddata.txt = file in which the data is saved showvisitors.php = the file where the saved data is displayed My question is about the data that is saved in saveddata.txt. data.php collects the refurl as a html code from every visitor and sent this to saveddata.txt. That is ok. But it collects also the visits with no refurl, so an empty html url. Now I can filter this out in showvisitors.php with str_replace, but 50% of saveddata.txt has empty html urls. This means I have to periodical clean that list manually. Is there a php function that I an use in data.php, so that empty data (<a href=""></a><br>) will not be collected anymore? TY Link to comment https://forums.phpfreaks.com/topic/160378-solved-what-is-the-best-way-to-let-out-specific-data/ Share on other sites More sharing options...
anupamsaha Posted May 31, 2009 Share Posted May 31, 2009 Hi, data.php = collects the data of visitors saveddata.txt = file in which the data is saved showvisitors.php = the file where the saved data is displayed My question is about the data that is saved in saveddata.txt. data.php collects the refurl as a html code from every visitor and sent this to saveddata.txt. That is ok. But it collects also the visits with no refurl, so an empty html url. Now I can filter this out in showvisitors.php with str_replace, but 50% of saveddata.txt has empty html urls. This means I have to periodical clean that list manually. Is there a php function that I an use in data.php, so that empty data (<a href=""></a><br>) will not be collected anymore? TY Did you try regular expression matches through preg_match()? Link to comment https://forums.phpfreaks.com/topic/160378-solved-what-is-the-best-way-to-let-out-specific-data/#findComment-846334 Share on other sites More sharing options...
redknight Posted May 31, 2009 Author Share Posted May 31, 2009 Did you try regular expression matches through preg_match()? You mean in data.php? That file collects in this format, so I don't see how I can use preg_match(). <a href=\x22$RefUrl\x22>$aPartOfRefUrl</a><br> Link to comment https://forums.phpfreaks.com/topic/160378-solved-what-is-the-best-way-to-let-out-specific-data/#findComment-846340 Share on other sites More sharing options...
anupamsaha Posted May 31, 2009 Share Posted May 31, 2009 Did you try regular expression matches through preg_match()? You mean in data.php? That file collects in this format, so I don't see how I can use preg_match(). <a href=\x22$RefUrl\x22>$aPartOfRefUrl</a><br> Please visit http://www.phpfreaks.com/forums/index.php/board,43.0.html Link to comment https://forums.phpfreaks.com/topic/160378-solved-what-is-the-best-way-to-let-out-specific-data/#findComment-846349 Share on other sites More sharing options...
redknight Posted May 31, 2009 Author Share Posted May 31, 2009 Thanks! Link to comment https://forums.phpfreaks.com/topic/160378-solved-what-is-the-best-way-to-let-out-specific-data/#findComment-846383 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.