unidox Posted June 6, 2008 Share Posted June 6, 2008 How do I turn an array into a string, so I can add to it? I used a split function to seperate ip's by |, and I need to add an ip to the array. Thanks Link to comment https://forums.phpfreaks.com/topic/108932-array/ Share on other sites More sharing options...
Buddski Posted June 6, 2008 Share Posted June 6, 2008 http://www.php.net/implode Link to comment https://forums.phpfreaks.com/topic/108932-array/#findComment-558866 Share on other sites More sharing options...
kenrbnsn Posted June 6, 2008 Share Posted June 6, 2008 You can just add to the array without making it a string again. <?php $ips = '1.2.3.4|5.6.7.1|11.22.3.44'; $ip_array = explode('|',$ips); echo '<pre>before:' . print_r($ip_array,true) . '</pre>'; $ip_array[] = '22.33.44.55'; echo '<pre>after:' . print_r($ip_array,true) . '</pre>'; ?> Ken Link to comment https://forums.phpfreaks.com/topic/108932-array/#findComment-558877 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.