ghostwalkz Posted May 15, 2008 Share Posted May 15, 2008 Hi guys, I have an array with various values. Now I can print a particular value to screen using: print_r($data[$server_id]['hostname']); which returns the hostname value inside the array. Perfect. BUT..... How can I turn that value into a string. I have tried $hostname = print_r($data[$server_id]['hostname']); but it doesn't work. Help would be greatly appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/105777-solved-really-easy-for-you-not-me-problem-with-an-array-value/ Share on other sites More sharing options...
trq Posted May 15, 2008 Share Posted May 15, 2008 $hostname = $data[$server_id]['hostname']; Quote Link to comment https://forums.phpfreaks.com/topic/105777-solved-really-easy-for-you-not-me-problem-with-an-array-value/#findComment-542017 Share on other sites More sharing options...
ghostwalkz Posted May 15, 2008 Author Share Posted May 15, 2008 Thanks Thorpe, that sorted it. Damn fast too! Quote Link to comment https://forums.phpfreaks.com/topic/105777-solved-really-easy-for-you-not-me-problem-with-an-array-value/#findComment-542023 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.