Welcome Guest, Not a member yet? Register   Sign In
anchor question
#1

[eluser]dimaomni[/eluser]
hello guys!
when I just output $marks all has been outputed good.

about output - it is table where is cells with marks and empty cells

when I've started used anchor function in empty cells has outputed links.

So how to avoid this situation ?
There is some piece of code:
Code:
foreach ($output_array as $key=>$marks)
          { ?>
            <td>&lt;?=anchor('index.php/adminka/'.$marks, $marks)?&gt;
              &lt;?=(!$marks) ? "&nbsp;":NULL // however if $marks = 0, it output &npsp;?&gt;
            </td>

Thanks!
#2

[eluser]pickupman[/eluser]
I believe it is still outputted because it exists. You have not used any typecasting, so 0 exists. You may want to try
Code:
&lt;?=($marks != '0') "&nbsp;" : '';?&gt;
#3

[eluser]Unknown[/eluser]
foreach ($output_array as $key=>$marks)
{ ?&gt;
<td>&lt;?=anchor('index.php/adminka/'.$marks, $marks)?&gt;
&lt;?=($marks === FALSE) ? "&nbsp;":NULL // however if $marks = 0, it output &npsp;?&gt;
</td>




Theme © iAndrew 2016 - Forum software by © MyBB