Jump to content

Array


unidox

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.