Karan Adhikari Karan Adhikari - 1 year ago 119
PHP Question

Get value from url codeigniter

I have a domain and id is coming in that domain like this

I want id value from the domain without passing ? instead of / in (query string)

Answer Source
<a href="http://www.test.com/update_record_row/6356/"> ID </a>

public function update_record_row($id)
    echo "Id is :".$id;


Use URI segment

// if URL -http://www.test.com/update_record_row/id/6356/
$id = $this->uri->segment(3);

// if URL -http://www.test.com/update_record_row/6356/
$id = $this->uri->segment(2);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download