Jump to content

[SOLVED] Strign Seperator on " | "


d22552000

Recommended Posts

Is it possible to take input and seperate it on every certain character or regular expression?  then split whats before to one string and whats after to another string?

 

I am making a webserver and I need to seperate the first line of a browser request:

 

"GET / HTTP/1.1" is an example call for root on the webserver

"GET /file/index.html HTTP/1.1" is a call for index in file directory.

 

I have seen people do it to seperate a string url:

 

$url = "http://domain.com/file"

 

turns into

 

$url1 = "http://"

$url2 = "domain.com"

$url3 = "/file"

 

but I wonder how they did it...  can you please help me?  I posted the topic earlier (12h ago) but it got buried.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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