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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.