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 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']; ?> 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 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'); ?> Link to comment https://forums.phpfreaks.com/topic/75425-solved-loading-an-array/#findComment-381559 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.