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 Quote Link to comment Share on other sites More sharing options...
Buddski Posted June 6, 2008 Share Posted June 6, 2008 http://www.php.net/implode Quote Link to comment 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 Quote Link to comment 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.