I am trying to save data into a string that can later be used.
this is the code that I have thus far:
$phone_numbers = $this->phone_model->get_all()->result();
$string = '';
foreach($phone_numbers as $cel){
$string .= 'Phone #: ';
$string .= $cel->cel_num;
$string .= '<br/>';
}
$data['string'] = $string;
my database has:
id cel_num
1 1324567890
2 1515744243
3 6516515225
There can be more or less
Then in my view I just have it as echo $string to echo the data
$html .='
<br/>
<br/>
<br/>
<br/>
<br/>
<table width="90%" align="center" style="border-bottom: 1px solid #000;">
<tr>
<th style="font-size:14px;" align="center">'.$contact->name.'<br />
<div style="font-size:10px">
'.$contact->addr.'<br />
////////// HERE IS WHERE I WANT TO ECHO THE NUMBERS/////////
'.$string.'
</div>
</th>
</tr>
<tr>
<th style="font-size:12px; font-weight:bold;" align="left">
PHONE BOOK</th></tr>
</table>';
$stringisn't working?