FXC Posted August 9, 2008 Share Posted August 9, 2008 Hi everybody, Right now I'm trying to make a script with php (which I haven't used in a long time) I have the extension DownThemAll for firefox and it can download alot of links at the same time. But some sites provide only the text(DownThemAll can only download links) example: www. example .com (and not www.example.com) (phpfreaks makes it an url automatic that's why there's a space) I want to make a script that get's the text from a text area (one text link a line) and turn them into link's. The problem is I don't now how to get the multiple lines seperatley and than at for each line a <a href tag I do know how to do it with one line but don't know it with multiple lines Help please Thanks alot already Quote Link to comment https://forums.phpfreaks.com/topic/118946-help-read-this-please-i-need/ Share on other sites More sharing options...
wildteen88 Posted August 9, 2008 Share Posted August 9, 2008 You'd use explode to separate each line. eg $txt = $_POST['your_textarea']; // standardize new lines $txt = str_replace(array("\r\n", "\r"), "\n", $txt); $lines = explode("\n", $txt); foreach($lines as $line) { echo $line . '<br />'; } Quote Link to comment https://forums.phpfreaks.com/topic/118946-help-read-this-please-i-need/#findComment-612467 Share on other sites More sharing options...
FXC Posted August 9, 2008 Author Share Posted August 9, 2008 Ok i'm gonna try it thanks Quote Link to comment https://forums.phpfreaks.com/topic/118946-help-read-this-please-i-need/#findComment-612469 Share on other sites More sharing options...
FXC Posted August 9, 2008 Author Share Posted August 9, 2008 Thanks it worked with some little editing For people who are interested you can see the result here: http://krentenbol78.freehostia.com/link.php Quote Link to comment https://forums.phpfreaks.com/topic/118946-help-read-this-please-i-need/#findComment-612489 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.