Karan Adhikari Karan Adhikari - 9 months ago 52
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);