Codeigniter get url parameters


Codeigniter get url parameters – You can get url parameters using url helper input get method. You can get the query string value from url using the below method.


Codeigniter get url parameters Example

You can get the url parameters simply as below-

Suppose we have following url and we want to get the url params-

Example:

www.example.com/my_controller/delete/99

You can get the controller method delete param value simply as below-

<?php
class My_controller extends CI_Controller {
public function delete($id = null){
 echo $id; // will print 99 the url parameter
}
}


Advertisements

Add Comment

📖 Read More