PHP

PHP array_column() Function

Usage The array_column() function returns the values from a single column in the input array. Syntax array_column(array,column_key,index_key); array: Required. Specifies the multi-dimensional array (record-set) to use column_key: Required. An integer key or a string key name of the column of values to return. This parameter can also be NULL to return complete arrays (useful together …

PHP array_column() Function Read More »

Load More Data

First In a ProductController : public function load_more_qna() { $product_id = $this->input->post(‘product_id’); $category = $this->input->post(‘category’); $start = $this->input->post(‘start’); $this->load->model(‘model_forum’); $forum_questions = $this->model_forum->get_product_question_answer(array(“product_id” => $product_id, “category” => (‘delivery’,’product’),”start” => $start)); if (isset($forum_questions) && !empty($forum_questions)) { $question_answer_array = array(); foreach ($forum_questions as $key => $value) { if (!isset($question_answer_array[$value[“question_id”]]) || !is_array($question_answer_array[$value[“question_id”]])) { $question_answer_array[$value[“question_id”]] = array(); } $question_answer_array[$value[“question_id”]][“question_id”] = …

Load More Data Read More »