Jump to content

php explode


Exoon

Recommended Posts

Hello

 

Ive got a text area and i want to seperate each link that is placed inside the text area,.

 

Is there a way using php exlode or somthing to reconise that the link has finished? Each of the links in the text area are on a new line.

 

Thanks in advance.

Link to comment
Share on other sites

<?php

if($_POST[newlinks]) {

$newlinks = $_POST['newlinks'];

$newlinks = explode(',', $newlinks);

    foreach ($newlinks as $newlink) {
      $new_number = substr("$newlink", -13, 4);    
      echo "Updating Number: $new_number with the link $newlink <br />";
   }
  
}





echo "<form method=\"POST\" action=\"mass_links.php\">";
echo "<br /> <strong>Enter the new links to try and replace old ones</strong> <br />";
echo "<textarea rows=\"16\" name=\"newlinks\" cols=\"84\"></textarea>";


?>
<input type="submit" value="Submit" name="B1">

 

 

That is using a commer which works but ide rather not have to type a commer after every link.

 

 

 

Some example links:

 

 

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.