Dat Posted September 3, 2008 Share Posted September 3, 2008 What is the best way to display this: <?php if ($USER[loggedin] == true): ?> Welcome to $SITE[sitename] $USERS[username], <?php endif; ?> The arrays have values. My question is what is the best and easiest way to echo these arrays? Obviously you can place '<?php echo $SITE[sitename] ?>' but I want to know an alternative because I will be placing these arrays all over my site. It would be tedious work to place echoing and php syntax's everywhere. Link to comment https://forums.phpfreaks.com/topic/122488-best-approach-printing-this/ Share on other sites More sharing options...
cyrixware Posted September 3, 2008 Share Posted September 3, 2008 What is the best way to display this: <?php if ($USER[loggedin] == true): ?> Welcome to $SITE[sitename] $USERS[username], <?php endif; ?> The arrays have values. My question is what is the best and easiest way to echo these arrays? Obviously you can place '<?php echo $SITE[sitename] ?>' but I want to know an alternative because I will be placing these arrays all over my site. It would be tedious work to place echoing and php syntax's everywhere. You can try create a page for your session() and include that file your session() in your every pages... Link to comment https://forums.phpfreaks.com/topic/122488-best-approach-printing-this/#findComment-632475 Share on other sites More sharing options...
Dat Posted September 3, 2008 Author Share Posted September 3, 2008 What is the best way to display this: <?php if ($USER[loggedin] == true): ?> Welcome to $SITE[sitename] $USERS[username], <?php endif; ?> The arrays have values. My question is what is the best and easiest way to echo these arrays? Obviously you can place '<?php echo $SITE[sitename] ?>' but I want to know an alternative because I will be placing these arrays all over my site. It would be tedious work to place echoing and php syntax's everywhere. You can try create a page for your session() and include that file your session() in your every pages... Example please? And a newbie explanation please xD Link to comment https://forums.phpfreaks.com/topic/122488-best-approach-printing-this/#findComment-632476 Share on other sites More sharing options...
Dat Posted September 6, 2008 Author Share Posted September 6, 2008 I found that this approach is the best solution but there is a problem with it: if ($USERCAN[viewuserlist] == 1) { $content = "<a href="$SITE[urlusers]/userlist.php">View Memberlist</a><br /><br /><br /> <b>User Links</b><br /> <a href="$SITE[urlusers]/logout.php">Logout</a><br />"; } As you can I have to add \" to every freaken quote! Link to comment https://forums.phpfreaks.com/topic/122488-best-approach-printing-this/#findComment-635065 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.