php ternary statement

Subject:

having trouble with a ternary if stmt

<?php echo ($atom[1] === "book-indexing-services" ? "class='activated'" : ""); ?>

2015-05-15 15:46:50gstlouis

references:

http://stackoverflow.com/questions/14214427/php-ternary-operator-not-working-as-expected

do not forget to echo when starting your ternary logic

gstlouis
vote
2015-05-15 15:47:25

                    foreach ($requests as $request) {
                        echo "<tr>
                                    <td><a href='/admin/requests/?id=".$request['id']."' data-                        id='".$request['id']."'>".$request['nom']." ".$request['prenom']."</a></td>
                                    <td>".$request['email_bureau']."</td>
                                    <td>".$request['tel_bureau']."</td>
                                    <td>".($request['annexer'] == 1 ? 'fuck' : '')."</td>
                                </tr>";
                        }

gstlouis
vote
2016-01-03 13:21:10