Jump to content

[SOLVED] more fine tuning substr I will get it sooner or later.


Looktrne

Recommended Posts

ok here is a tough one for me..

 

I need to strip this string

 

http://www.nosite.net/members/index.php?page=whos_online

 

it needs to become

 

nosite.net

 

I also need to strip it to just:

 

http://www.nosite.net

 

keep in mind that this may or may not contain the www. and it needs to cut the string from the / but leave the first double // along

 

any ideas?

 

Paul

this code worked for cleaning a url

 

 $code="http://abmatch.com/index.php?page=contact";
  $mem	= strpos($code, "//"); 
  $code	= substr($code, ($mem)+2, strlen($code)); 

  $mem	= strpos($code, "/"); 
  $code	= substr($code, 0, $mem); 

 

:) thanks

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.