Ow Mun Heng <[EMAIL PROTECTED]> wrote:
> Hi All,
> 
>       Just a quick question on this. In my scripts, I'm using A LOT Of
> $GLOBALS['my_parameter'] to get the declared values/string. 1 example  below
> :
> 
> function display_menu_html()
> {
>       echo '<table class="width100" cellspacing="0">'."\n";
>       echo '<tr>'."\n";
>       echo "\t".'<td class="menu">'."\n";
>       echo "\t".'<a href="home.php">' . $GLOBALS['home'] . "</a>
>
> [...]
>        
> }
> 
> This isn't really a Problem but.. is it bad programming practice?? Or I
> should just write another function that can return the values/string?


yes and no, that is rather a debatable question.  

To make my functions that echo stuff cleaner I usually do stuff like:

function show_html() {
<?
<table class="width100" cellspacing="0">
  <tr>
    <td class="menu">
      <a href="someplace.php"><?php echo $var?></a>
    </td>
  </tr>
</table>
?>
}
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to