| |||||||
| CODE This forum is for posting code snippets and example scripts that aren't quite tutorials, but could be useful for others. You may post code snippets and/or completed scripts that you've written and want to share here. |
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) | |
| Account Closed | 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: Quote:
Thanks in advance. Last edited by YesBrilliant; 03-12-2007 at 10:22 AM. | |
| |
| | #5 (permalink) |
| NamePros Member | Well, I can't understand what you trying to do. Maybe you like to explain to me in more detail so I can assist you on the problem?
__________________ tanfwc [ My HomePage ] My Project : Free Image Hosting # Shorten your URL! # Submit your proxy Cheap VPS on GNAX Network -- starting US$12.99/mo! |
| |
| | #6 (permalink) | |
| Account Closed | Quote:
What I need is to include the extension org.uk in that sequence of top TLDs, which are listed Without the "." in front of them. The extension org.uk has a "." between the org and the uk, what interferes in the results. That script is a Domain List Cleaner where all characters/words that are not part of a domain then are excluded from the results. The way the list is now make domains like test.org.uk to be excluded as well, when they shoudn't. For example, the way the script is now, an example list like: 1. test.com 2 . test.net zxzx zxz.xzxzxz 3. test.org.uk 4. test.ca .kjkjk 5. 4444 test.us 1212121212112 would return only: test.com test.net test.ca test.us thus also excluding the test.org.uk domain as garbage simply because it has a "." in there. So the question: How to include the org.uk in that sequence of top TLDs? Your help is appreciated. Last edited by YesBrilliant; 03-08-2007 at 08:02 PM. | |
| |
| | #11 (permalink) |
| Account Closed | I just updated the first post the way I am using now. However, still getting incorrect results. I also tried to put the org.uk in the start of the sequence but same error. Another example, checking: wwwwwwwww.org.uk wwwwwwwww.co.uk wwwwwwwww.org wwwwwwwww.com wwwwwwwww.ws Returns only: wwwwwwwww.org.uk wwwwwwwww.org Thanks again, I really appreciate your help. Mark. |
| |
| | #12 (permalink) | |
| NamePros Member | Quote:
Secondly, unless you have that original code somewhere, you're going to have to take my word for it that with that sample set, your original code did the same thing :) The problem that you experienced there is related not to the regular expression being used to match, but the regular expression you're using to split. The split assumes that you have a space on the line: newlines were not being considered... Replace: $list = split(" +", $domains); with: $list = split("[[:space:]]+", $domains); and see how it goes... | |
| |
| | #13 (permalink) | |
| Account Closed | Hey, Great! It IS working perfectly now!!! I even included some other extensions and subdomains assigned by the registry and all went all again! You can see the Final script below. The first post now returned to the Original script. Thanks a lot, TwistMyArm! You are a great NP member!!! Sent you a PM. Quote:
| |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |