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 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 />'; } 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 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 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
Archived
This topic is now archived and is closed to further replies.