Hi there,
I would like to know how can I call two methods from library in a loop? For example I have library called "Test" and I load it in my controller
I have array with values, for example:
Now I have to loop through that array and call two methods from my library:
My problem is that after the first call of these methods I can see returned value but after that I'm not getting any remaining values. How can I achieve that in CodeIgniter?
I would like to know how can I call two methods from library in a loop? For example I have library called "Test" and I load it in my controller
PHP Code:
$this->load->library('test');
I have array with values, for example:
PHP Code:
$values = array(10, 20, 30, 40, 50);
Now I have to loop through that array and call two methods from my library:
PHP Code:
foreach($values as $value) {
$this->test->set($value);
$returned_value = $this->test->get();
echo $returned_value.'<br>';
}
My problem is that after the first call of these methods I can see returned value but after that I'm not getting any remaining values. How can I achieve that in CodeIgniter?