Welcome Guest, Not a member yet? Register   Sign In
Check field and rewrite to array
#1

[eluser]kolxoznik1[/eluser]
I need to truncate string and rewrite it back to array

I have got a function where I get data to array from data base

Code:
$data['about_text_list'] = $this->about_text_model->get_array();

I get these fields from data base : id, num, header, text, language



I need to strip_tags and truncate text in array $data['about_text_list'] in every field 'text' and rewrite new data back to array $data['about_text_list']

I try to do this

Code:
foreach ($data['about_text_list'] as $items)
        {
            $data['about_text_list']['text'] = word_limiter($items['text'], 100);

            $data['about_text_list']['text'] = strip_tags($items['text']);
        }

After all I send array to view and in view I do foreach to displat text

Code:
<? foreach ($about_text_list as $line) : ?>

    <td>&lt;?=$line['text']?&gt;</td>

&lt;? endforeach; ?&gt;

But I do not get any error and I get the full text with all html tags. Please tell me how to do this (operation with array)




Theme © iAndrew 2016 - Forum software by © MyBB