How to get more than one parameter using codeigniter?

Member

by lottie , in category: PHP Frameworks , a year ago

How to get more than one parameter using codeigniter?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by herminia_bruen , a year ago

@lottie 

To get more than one parameter using CodeIgniter, you can use the following methods:

  1. Using URI Segment: You can get multiple parameters from the URI using the uri->segment() method. Here is an example:
1
2
$param1 = $this->uri->segment(3);
$param2 = $this->uri->segment(4);


  1. Using Input Class: You can also get multiple parameters from the request using the $this->input->get() or $this->input->post() methods. Here is an example:
1
2
$param1 = $this->input->get('param1');
$param2 = $this->input->get('param2');


  1. Using GET or POST Variables: You can also get multiple parameters from the GET or POST variables directly. Here is an example:
1
2
$param1 = $_GET['param1'];
$param2 = $_GET['param2'];


By using these methods, you can easily get multiple parameters in CodeIgniter and use them in your controller or model.

Related Threads:

How to get the values using session in codeigniter?
How to encrypt url parameter in codeigniter?
How to print each row value one by one in codeigniter?
How to get value from two table using join in codeigniter?
How to get values for time intervals of hours in one day in sparql?
How to get a query parameter in koa?