Jump to content

[HELP] Read this please I need .......


FXC

Recommended Posts

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 :D

 

Thanks alot already  ;D

Link to comment
https://forums.phpfreaks.com/topic/118946-help-read-this-please-i-need/
Share on other sites

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 />';
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.