I have million (1,000,000) domains list.
+----+--------------+--------------------------+
| Id | Domain_Name | Correct_URL |
+----+--------------+--------------------------+
| 1 | example1.com | http://www.example1.com |
| 2 | example2.com | https://exmple2.com |
| 3 | example3.com | https://www.example3.com |
| 3 | example4.com | http://example4.com |
+----+--------------+--------------------------+
ID
and Domain_Name
column is filled.
Correct_URL
column is empty.
Question : I need to fill the Correct_URL
column.
The problem I face is how do I find the prefix part before the domain. It may either http://
or http://www.
or https://
or https://www.
How do I find correctly what is from above 4 using PHP? Please note that I need to run code to all 1,000,000 domains.... So I am looking at a fastest way to check it...
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…