Thread: php sessions
View Single Post
Old 10-11-2007, 10:32 AM   #41 (permalink)
Rating: 0% (0)
Matthew King
Advancing Real Estate agent
 
Matthew King's Avatar
 
Join Date: Jul 2007
Posts: 95
Default

Easiest way is to do this:

Code:
<table>
   <tr>
      <th>Reference</th>
   </tr>

<?php
        session_start();

        $references = explode(',' $_SESSION['portfolio']);

        foreach($references as $ref) {
            if (strlen($ref) > 0) {
            ?>
               <tr>
                     <td><?= $ref; ?></td>
               </tr>
            <?php
            }
        }
    ?>

</table>
Basically that's now checking the length of the $ref before printing the row, so it'll automatically cut the first empty one out.
__________________
Real Estate Web Developer & SEO Consultant

www.costablancapropertyportal.com | Costa Blanca Property | Javea Property for sale
Matthew King is offline   Reply With Quote
 

Spanish Real Estate Forum - Members newest adverts
CH5 New Villa Costa Azahar
A Castle in Spain
Costa Azahar Village House for sale
CHL Investment Opportunity Coasta Azahar
Cervera del Maestre Property