Welcome Guest, Not a member yet? Register   Sign In
how to take a url from a url with $url = $this->uri->segment() or ?
#1

[eluser]Unknown[/eluser]
hello all can i ask for a little help?

I have this problem with $url = $this->uri->segment(); i need to take a url from the url.

i'll explain i need to take from this url domain.com/1/2/3/domeina.net/ifnoto/*
all after /3/ how to do that with uri->segment() or something else
#2

[eluser]Harold Villacorte[/eluser]
You could probably get something like this working.
Code:
$this->load->helper(url);
$current_url = current_url();
$url = str_replace('http://domain.com/1/2/3/', '', $current_url);
#3

[eluser]Unknown[/eluser]
tnx i do this
Code:
$uri = $this->uri->uri_string();
   $url = explode("/", $uri, 4);
   $site = $url[3];
   $site2 = str_replace('http:/', 'http://', $site);
I add $site2 because for some reason the url[3] remove one / from http://

tnx for your help




Theme © iAndrew 2016 - Forum software by © MyBB