从会话数组获取单个数据-CodeIgniter

时间:2018-11-08 10:33:39

标签: codeigniter session

我想从控制器发送的视图中的flashdata数组中获取单个值。

控制器:

        $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); 

视图

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

上面的结果给了我以下结果。

array(5){[“” author_id“] => string(1)” 6“ [” title“] => string(3)” uyk“ [” subtitle“] => string(26)” Full- Stack Web开发“ [” post“] =>字符串(1)” u“ [” image“] =>字符串(0)”“}

如何仅获得标题或副标题之类的单个值?

1 个答案:

答案 0 :(得分:1)

这个 with tf.Session() as test: tf.set_random_seed(1) y_true = (None, None, None) y_pred = (tf.random_normal([3, 128], mean=6, stddev=0.1, seed = 1), tf.random_normal([3, 128], mean=1, stddev=1, seed = 1), tf.random_normal([3, 128], mean=3, stddev=4, seed = 1)) loss = triplet_loss(y_true, y_pred) print("loss = " + str(loss.eval()))