cheechm Posted October 30, 2007 Share Posted October 30, 2007 Say I have this array: ////////////////////////////////////////////////////////////////////////// $lang = array ( //homepage 'welcome' => "Welcome to the official website of Me" ); That is in lang.php How would I display that in index.php? Thanks (Also could you point me to some good vid tutorials (free/paid)) THanks Quote Link to comment https://forums.phpfreaks.com/topic/75425-solved-loading-an-array/ Share on other sites More sharing options...
trq Posted October 30, 2007 Share Posted October 30, 2007 <?php include 'lang.php'; echo $lang['welcome']; ?> Quote Link to comment https://forums.phpfreaks.com/topic/75425-solved-loading-an-array/#findComment-381553 Share on other sites More sharing options...
cheechm Posted October 30, 2007 Author Share Posted October 30, 2007 Genius lol.. Thanks What about: 'welcome'=> "Welcome to the official website of %s" Say the string was Me.. How would you echo that? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/75425-solved-loading-an-array/#findComment-381555 Share on other sites More sharing options...
trq Posted October 30, 2007 Share Posted October 30, 2007 <?php include 'lang.php'; printf($lang['welcome'],'Me'); ?> Quote Link to comment https://forums.phpfreaks.com/topic/75425-solved-loading-an-array/#findComment-381559 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.