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. 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']; 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! 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
Archived
This topic is now archived and is closed to further replies.