kikookik Posted September 26, 2013 Share Posted September 26, 2013 Hello; I want to remove any instance of such : <link rel="stylesheet" href="ANYTHING HERE.css" type="text/css"> Quote Link to comment https://forums.phpfreaks.com/topic/282463-remove-all-link-stylesheets-from-document-regex-or-dom/ Share on other sites More sharing options...
.josh Posted September 27, 2013 Share Posted September 27, 2013 Sounds like you have a battle plan. Quote Link to comment https://forums.phpfreaks.com/topic/282463-remove-all-link-stylesheets-from-document-regex-or-dom/#findComment-1451336 Share on other sites More sharing options...
Irate Posted September 27, 2013 Share Posted September 27, 2013 To make sure, you are going to run this on your own server and do not plan to do XSS, right? Yeah, you better. Check JavaScript to write some code for that, otherwise just don't include them in your document. Quote Link to comment https://forums.phpfreaks.com/topic/282463-remove-all-link-stylesheets-from-document-regex-or-dom/#findComment-1451459 Share on other sites More sharing options...
ignace Posted September 27, 2013 Share Posted September 27, 2013 (edited) This snippet should remove any and all <link/> tags. echo preg_replace('!<link([^>]+)/?>!', '', file_get_contents('http://domain.top/file.ext')); Edited September 27, 2013 by ignace Quote Link to comment https://forums.phpfreaks.com/topic/282463-remove-all-link-stylesheets-from-document-regex-or-dom/#findComment-1451464 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.