0

Hai I am using codeigniter...I my function phpcalview()... This is my function

function phpcalview()
 {
     $year = $this->input->post('yearvv');
  $data['year'] = $this->adminmodel->selectyear();
  $data['date'] = $this->adminmodel->selectmonth();
  print_r($data['date'] );

  $this->load->view('phpcal',$data); 
 }

I am printing the values with print_r($data['date'] ); I get values like

Array ( [0] => Array ( [dbdatenum] => 1 ) [1] => Array ( [dbdatenum] => 2 ) [2] => Array ( [dbdatenum] => 3 ) [3] => Array ( [dbdatenum] => 4 ))

I want to display the array seperately as array[0],array[1] in my view page how can i do that

1 Answer 1

2

You can use foreach:

foreach ($your_array as $key => $value)
echo "[".$key."]=>".$value ";
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.