• Welcome to DNForum.com - Domain Investor Forum, Free Domain Marketplace and a community for 45+ domain pros
    If you are new to domains and looking to buy, sell and learn about domains then you have come to the right place. DNForum is the oldest global domain name community on the internet and continues to grow every day. There are over 45,000 domainers on DNForum doing everything from buying domains, selling domains, using our free in-house built tools, learning about domains and discussing domains. Take a minute and Register.

How to clean this?

  • Thread starter Thread starter tekz999
  • Start date Start date
Status
Not open for further replies.
T

tekz999

Guest
I have a list of list like this below:

1. proxy.xmission.com:8080
2. host54.nokia-boston.com:8080
3. 66.35.211.141:80
4. client-220-254.bhm.pogozone.net:3128
5. client-220-253.bhm.pogozone.net:3128
6. c-24-21-35-9.hsd1.or.comcast.net:8080
7. bess-proxy2.miamiarch.org:3128
8. bess-proxy.miamiarch.org:3128
.
.
.


I dont want the "1." "2." "3."... numbers in front, I am looking for a script to clean those numbers, anyone has any idea how to do that? :huh: d:)
 
Heres a 5 minutes script i did for you. (2 files: form.html and split.php)

Content of form.html
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Split Form</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form name="form" method="post" action="split.php">
  <textarea name="list" cols="50" rows="15"></textarea>
  <br>
  <input name="submit" type="submit" value="SplitZor">
</form>
</body>
</html>

Content of split.php:
PHP:
<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
<html>
<head>
       <title>Split!</title>
</head>
<body>
<?php
$blocks = $HTTP_POST_VARS['list'];
$items = explode("\n", $blocks);

foreach ($items as $proxies) {
    $proxy = explode(" ", $proxies);
    echo "$proxy[1] <br>";
}
?>
</body>
</html>

This will convert your list of items from 1. proxy.xmission.com:8080 to proxy.xmission.com:8080 for example.

Code:
1. proxy.xmission.com:8080
2. host54.nokia-boston.com:8080
3. 66.35.211.141:80
4. client-220-254.bhm.pogozone.net:3128
5. client-220-253.bhm.pogozone.net:3128
6. c-24-21-35-9.hsd1.or.comcast.net:8080
7. bess-proxy2.miamiarch.org:3128
8. bess-proxy.miamiarch.org:3128
Code:
proxy.xmission.com:8080 
host54.nokia-boston.com:8080 
66.35.211.141:80 
client-220-254.bhm.pogozone.net:3128 
client-220-253.bhm.pogozone.net:3128 
c-24-21-35-9.hsd1.or.comcast.net:8080 
bess-proxy2.miamiarch.org:3128 
bess-proxy.miamiarch.org:3128
 
Status
Not open for further replies.
Back
Top Bottom