[eluser]phantom-a[/eluser]
[quote author="NateL" date="1221077796"]it simply appends, rather than overwrites.
in other words (taking from phantom-a's example)...
Code:
<?php
$output = 'CodeIgniter';
$output .= 'rocks';
echo $output;
?>
the echo $output command would output "CodeIgniterrocks" (literally...since there were no spaces er anything :-) )
However, if you had
$output = 'CodeIgniter';
$output = 'rocks';
it would output "rocks". You're initially setting $output to 'CodeIgniter', and then if you don't put the .=, you are re-setting $output to 'rocks'.
again, .= just appends to what is already there.[/quote]
Yes its very simple, actually the reason I asked yesterday is I was trying to understand what this does but know I fully understand it.
Code:
$output = '<ul>';
foreach ($query->result() as $function_info) {
if ($description) {
$output .= '<li><strong>' . $function_info->name . '</strong><br />';
$output .= $function_info->function_description . '</li>';
} else {
$output .= '<li>' . $function_info->function_name . '</li>';
}
$output .= '</ul'>;
return $output
} else{
return '<p>Sorry no results</p>';
}