YesBrilliant
Account Closed
- Impact
- 38
Hi,
This is a basic question but I have no experience with coding in PHP, hope you understand.
I have an array/list of extensions and need to include the subdomain extension .org.uk but I can not do it right.
This is the original code, a domain list cleaner script:
Can anyone help me, please?
Thanks in advance.
This is a basic question but I have no experience with coding in PHP, hope you understand.
I have an array/list of extensions and need to include the subdomain extension .org.uk but I can not do it right.
This is the original code, a domain list cleaner script:
<html>
<head>
<title>Domain List Cleaner</title>
<body>
<center>
<form method="post" action="">
<textarea name="domains" rows="15" cols="60">
<?php
$temparray = array();
$domains = $_POST['domains'];
if ($domains)
{
$list = split(" +", $domains);
foreach ($list as $value)
{
preg_match("/[a-z-A-Z0-9-]+\.(com|net|org|us|biz|info|cc|ca|br|tv|ac|ag|am|at|be|bz|ch|cn|de|es|eu|fm|gs|im|in|io|jobs|jp|la|li|mn|mobi|ms|name|nl|pl|ru|sc|se|sg|sh|tc|tk|tm|tw|vc|vg|uk|ws)/", $value, $matches);
for ($i = 0; $i < count($matches); $i++)
{
array_push($temparray, $matches[0]);
}
}
$uniquearray = array_unique($temparray);
foreach ($uniquearray as $uniquevalue)
{
echo "$uniquevalue\n";
}
}
?>
</textarea>
<br />
<input size="45" type="submit" value="Submit">
</form>
</center>
</body>
</html>
Can anyone help me, please?
Thanks in advance.
Last edited: