Jump to content

explode the site name


mrjameer

Recommended Posts

First of MadTechie is right... explode is what you are looking for and the link he gave is excellent.

 

Second, sorry for going off topic:

 

MadTechie: Can we (you, me and anyone else who refers to things as "being in the manual") expect people who are new to PHP to be able to find for example explode() in the manual when they need to split a string? To link the splitting of a string to explode()?

 

My personal opinion on this is that if you can't link for example splitting a string to explode() you should read some basic PHP tutorials or books.

Link to comment
https://forums.phpfreaks.com/topic/74117-explode-the-site-name/#findComment-374306
Share on other sites

I think the question, was kinda pointless..

he refers to site name being www.welcome.com

and to break or explode.. so to look at the post again

he might of well said

 

i want to explode www.welcome.com and store in 3 different variables as follows .

$variable1=www;

$variable2=welcome;

$variable3=com;

 

also if you look in the manual, section "strings"

and read the list your find "explode — Split a string by string",

 

i don't mind helping but i have spent just under 2 days trying to resolve a problem and was very close to posting.. sometimes i know is something stupid i have done.. and a second pair of eyes help.. but this post just seams too lazy.. hence the "oh yes it is.."

 

Link to comment
https://forums.phpfreaks.com/topic/74117-explode-the-site-name/#findComment-374320
Share on other sites

also take a look how parse_url() works.

 

But their are adherint problems with .co.jp com.cn etc. these are called TLD's if you want this to work perfectly for all combination fo domains extensions you will need to get a TLD dump and the script for doing this...

 

It gets a bit complecated so just possibility of what possible.

Link to comment
https://forums.phpfreaks.com/topic/74117-explode-the-site-name/#findComment-374447
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.