only one Posted May 7, 2007 Share Posted May 7, 2007 hi i want to make a page that gathers how many posts ive posted on forums, i was trying to use a code i was planning to first of all open the document, read it, then strip the tags and preg_replace all the other content (i reallised it wouldnt work) i got this far, but it didnt seem to work at all: <?php $filename = "http://www.phpfreaks.com/forums/index.php?action=profile;u=45841"; $handle = fopen($filename, "r"); $contents = fread($handle); $strip = strip_tags($contents); echo "$strip"; ?> anyone got any ideas? thanks, Only Quote Link to comment https://forums.phpfreaks.com/topic/50395-gather-info-from-html-doc/ Share on other sites More sharing options...
per1os Posted May 7, 2007 Share Posted May 7, 2007 www.php.net/file_get_contents or www.php.net/file I think fopen you would have to do a loop to get it into a string/array. file_get_contents puts it into a string file puts it into an array. Quote Link to comment https://forums.phpfreaks.com/topic/50395-gather-info-from-html-doc/#findComment-247508 Share on other sites More sharing options...
only one Posted May 7, 2007 Author Share Posted May 7, 2007 kk thanks ill have a look Quote Link to comment https://forums.phpfreaks.com/topic/50395-gather-info-from-html-doc/#findComment-247510 Share on other sites More sharing options...
Nameless12 Posted May 7, 2007 Share Posted May 7, 2007 http://au.php.net/manual/en/function.fgetss.php And the reason your fread is not working is you did not specify a size, try adding an additional argument of filesize($filename) EDIT, SimpleXML or the DOM is better suited to what you are trying to do. Quote Link to comment https://forums.phpfreaks.com/topic/50395-gather-info-from-html-doc/#findComment-247535 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.