I have something like this:
host1 | port1
host2 | port2
host3 | port3
host4 | port4
Now, I need to insert pairs into an array so I can use them in a loop:
I tried to loop through one value of an array
$hosts = array('host1','host2','host3');
foreach ($hosts as $host) {
echo $host;
}
How do I add pairs to an array so I can call say host it outputs both host and port?