0

I want to get single value from the flashdata array in the view which is sent from the controller.

controller:

        $post=array(
            'author_id'=>$this->input->post('author'),
            'title'=>$this->input->post('post_title'),
            'subtitle'=>$this->input->post('post_subtitle'),          
            'post'=>$this->input->post('textarea1'), 
            'image'=>$this->upload->file_name,          
        );

        $this->session->set_flashdata('postdata',$post); 

view

<?php var_dump($this->session->flashdata('postdata'))?>   

The above gave me the following result.

array(5) { ["author_id"]=> string(1) "6" ["title"]=> string(3) "uyk" ["subtitle"]=> string(26) "Full-Stack Web Development" ["post"]=> string(1) "u" ["image"]=> string(0) "" }

How can I get only single value like title or subtitle?

1 Answer 1

1

What about this $this->session->userdata['postdata']['title']

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.