public function cc_to_html($data = array())
 {
     // set return result
     $result = array("status" => false, "message" => "", "data" => "");
     // check data must be an array
     if (is_array($data)) {
         // check data is not empty
         if (count($data) > 0) {
             // set blank html
             $html = "";
             $data = array_reverse($data);
             foreach ($data as $comment) {
                 $detail = strip_tags($comment["comment"]);
                 $detail = make_url_to_link($detail);
                 $detail = str_replace('\\n\\r', '<br />', $detail);
                 $detail = preg_replace('/^(?:<br\\s*\\/?>\\s*)+/', '', $detail);
                 $since = c_get_time_elapsed(strtotime($comment['added_on']));
                 $user = $this->is_valid_user($comment['posted_by']);
                 $name = $user ? $user['name'] : 'Unknow user';
                 $image = get_profile_pic($user['id'], $user['profile_pic']);
                 $html .= "\n                    <div class='leftine'>\n                        <div class='comm'>&nbsp;</div>\n                        <div class='commhead'>&nbsp;</div>\n                        <div class='smalluserimg'><img alt='' src='{$image}' /></div>\n                        <div class='smallusertxt'> <span class='star_headdrop'>{$name}</span>\n                            <p>{$detail}</p>\n                            <span style='color: #646464; float: left; font-size: 13px'>{$since}</span>\n                        </div>\n                    </div>";
             }
             $result["status"] = true;
             $result["message"] = "Data successfully converted array to html.";
             $result["data"] = $html;
         } else {
             $result["message"] = "Data is empty.";
         }
     } else {
         $result["message"] = "Data is not array kindly pass an array.";
     }
     // return result
     return $result;
 }
 public function feeds_to_html($data = array())
 {
     // set return result
     $result = array("status" => false, "message" => "", "data" => "");
     // check data must be an array
     if (is_array($data)) {
         // check data is not empty
         if (count($data) > 0) {
             // set blank html
             $group = "";
             $html = "";
             $control = 0;
             $serial = 0;
             foreach ($data as $feed) {
                 $feed_id = $feed['id'];
                 $title = strip_tags($feed['title']);
                 $title = word_limiter($title, 7);
                 $eco_pic_dir = ($feed['data_type'] == 'voice' or $feed['data_type'] == 'stream') ? "voices" : "ecosystem";
                 $image = "/user_files/prof/" . $feed['user_id'] . "/{$eco_pic_dir}/" . $feed['eco_pic'];
                 $since = c_get_time_elapsed(strtotime($feed['created_on']));
                 $detail = strip_tags($feed["details"]);
                 $detail = make_url_to_link($detail);
                 $detail = str_replace('\\n\\r', '<br />', $detail);
                 $detail = preg_replace('/^(?:<br\\s*\\/?>\\s*)+/', '', $detail);
                 $detail = word_limiter($detail, 10);
                 $userdata = $this->session->userdata('user_data');
                 $uid = $feed['user_id'];
                 $user = $this->Mod_User->get_user($uid);
                 $user_image = "/user_files/prof/{$uid}/" . $user['data']['profile_pic'];
                 if (!file_exists($_SERVER['DOCUMENT_ROOT'] . $user_image)) {
                     $user_image = "/assets/images/ep.png";
                 }
                 $single_feed_url = base_url() . $feed['data_type'] . '/' . $feed_id;
                 $data_type = ucwords($feed['data_type']);
                 ++$serial;
                 if ($control == 0) {
                     $group = "<div class='container_705'><ul class='dropcontainer'>";
                     ++$control;
                 } else {
                     $group = "";
                     ++$control;
                 }
                 $text = $feed['data_type'] == 'voice' ? 'Vote' : 'View';
                 $list = "\n                            <li>\n                                <div class='wwf_the_outer' style='background: url({$image}) no-repeat scroll 0 0 / 100% 100px rgba(0, 0, 0, 0)'>\n                                    <div class='image_wwf'>\n                                        <img src='{$user_image}' alt='' style='width: 56px; height: 56px;' />\n                                    </div>\n                                    <h4>{$title}</h4>\n                                    <p>{$detail}</p>\n                                    <a href='{$single_feed_url}' class='yellow_btn'>{$text}</a>\n                                    <p>{$since}</p>\n                                    <div class='srachbar'>{$data_type}</div>\n                                </div>\n                            </li>\n                    ";
                 $html .= $group . $list;
                 if ($control == 3) {
                     $group = "</ul></div><div class='brdrall'></div>";
                     $control = 0;
                 } else {
                     $group = "";
                 }
                 if ($serial == count($data)) {
                     $group = "</ul></div><div class='brdrall'></div>";
                 }
                 $html .= $group;
             }
             $result["status"] = true;
             $result["message"] = "Data successfully converted array to html.";
             $result["data"] = $html;
         } else {
             $result["message"] = "Data is empty.";
         }
     } else {
         $result["message"] = "Data is not array kindly pass an array.";
     }
     // return result
     return $result;
 }
<?php

if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
$config = c_get_config();
$stream_id = $stream['id'];
$title = strip_tags($stream['question_text']);
$image = "../../user_files/prof/" . $stream['user_id'] . "/voices/" . $stream['voice_pic'];
//$since = c_get_time_elapsed(strtotime($stream['added_on']));
$detail = strip_tags($stream["voice_details"]);
$detail = make_url_to_link($detail);
$detail = nl2br($detail);
$detail = preg_replace('/^(?:<br\\s*\\/?>\\s*)+/', '', $detail);
$cat_name = $category['category'];
$tag = "";
for ($i = 0; $i < count($tags); $i++) {
    $tag .= "<span class='bluebutton_drop' style='cursor: default;'>{$tags[$i]}</span>&nbsp;&nbsp;&nbsp;";
}
$moderator_name = isset($moderator['name']) ? $moderator['name'] : 'Unknown user';
$follow_name = $is_follower ? "Unfollow" : "Follow";
$follow_class = $follow_name ? "mark-unfollow" : 'mark-follow';
?>

<!-- invite box -->
<div id="inline1" style="width:100%;display: none; overflow:hidden;">
    <div class="persevnfif mrgnleftnone">
        <h4>Please select which stream you would<br /> like to merge with your stream:</h4>
        <div class="wdthhundr mrgnleftnone">
            <label class="lefttws perthir mrgntop"><strong>My Streams</strong></label>
            <span class="leftsinptres persevntwtw mrgntop"><?php 
 public function mv_to_html($data = array())
 {
     // set return result
     $result = array("status" => false, "message" => "", "data" => "");
     // check data must be an array
     if (is_array($data)) {
         // check data is not empty
         if (count($data) > 0) {
             // set blank html
             $group = "";
             $html = "";
             $control = 0;
             $serial = 0;
             foreach ($data as $voice) {
                 $voice_id = $voice['id'];
                 $title = strip_tags($voice['question_text']);
                 $title = word_limiter($title, 7);
                 $image = "../user_files/prof/" . $this->get_logged_uid() . "/voices/" . $voice['voice_pic'];
                 $since = c_get_time_elapsed(strtotime($voice['added_on']));
                 $detail = strip_tags($voice["voice_details"]);
                 $detail = make_url_to_link($detail);
                 $detail = str_replace('\\n\\r', '<br />', $detail);
                 $detail = preg_replace('/^(?:<br\\s*\\/?>\\s*)+/', '', $detail);
                 $detail = word_limiter($detail, 10);
                 $userdata = $this->session->userdata('user_data');
                 $uid = $userdata['uid'];
                 $user = $this->Mod_User->get_user($uid);
                 $user_image = get_profile_pic($uid, $user['data']['profile_pic']);
                 $single_voice_url = base_url() . $this->_config['single_voice_url'] . '/' . $voice_id;
                 ++$serial;
                 if ($control == 0) {
                     $group = "<div class='container_705'><ul class='dropcontainer'>";
                     ++$control;
                 } else {
                     $group = "";
                     ++$control;
                 }
                 $list = "\n                            <li>\n                                <div class='wwf_the_outer' style='background: url({$image}) no-repeat scroll 0 0 / 100% 100px rgba(0, 0, 0, 0)'>\n                                    <div class='image_wwf'>\n                                        <img src='{$user_image}' alt='' style='width: 56px; height: 56px;' />\n                                    </div>\n                                    <h4>{$title}</h4>\n                                    <p>{$detail}</p>\n                                    <a href='{$single_voice_url}' class='yellow_btn'>Vote</a>\n                                    <p>{$since}</p>\n                                </div>\n                            </li>\n                    ";
                 $html .= $group . $list;
                 if ($control == 3) {
                     $group = "</ul></div><div class='brdrall'></div>";
                     $control = 0;
                 } else {
                     $group = "";
                 }
                 if ($serial == count($data)) {
                     $group = "</ul></div><div class='brdrall'></div>";
                 }
                 $html .= $group;
             }
             $result["status"] = true;
             $result["message"] = "Data successfully converted array to html.";
             $result["data"] = $html;
         } else {
             $result["message"] = "Data is empty.";
         }
     } else {
         $result["message"] = "Data is not array kindly pass an array.";
     }
     // return result
     return $result;
 }
<?php

if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
$config = c_get_config();
$river_id = $river['id'];
$title = strip_tags($river['title']);
$image = "../../user_files/prof/" . $river['moderator_id'] . "/ecosystem/" . $river['eco_pic'];
//$since = c_get_time_elapsed(strtotime($stream['added_on']));
$details = strip_tags($river["description"]);
$details = make_url_to_link($details);
$details = nl2br($details);
$details = preg_replace('/^(?:<br\\s*\\/?>\\s*)+/', '', $details);
$cat_name = $category['category'];
$tag = "";
for ($i = 0; $i < count($tags); $i++) {
    $tag .= "<span class='bluebutton_drop' style='cursor: default;'>{$tags[$i]}</span>&nbsp;&nbsp;&nbsp;";
}
$moderator_name = isset($moderator['name']) ? $moderator['name'] : 'Unknown user';
$follow_name = $is_follower ? "Unfollow" : "Follow";
$follow_class = $follow_name ? "mark-unfollow" : 'mark-follow';
?>

<!-- invite box -->
<div id="inline1" style="width:100%;display: none; overflow:hidden;">
    <div class="persevnfif mrgnleftnone">
        <h4>Please select which river you would<br /> like to merge with your river:</h4>
        <div class="wdthhundr mrgnleftnone">
            <label class="lefttws perthir mrgntop"><strong>My Rivers</strong></label>
            <span class="leftsinptres persevntwtw mrgntop"><?php