I have below array where I am getting this array by executing an MySQL query in zend.
I want to concatenate all the octent and get the result as 131.208.0.0 and 141.128.0.0 to pass to view to display.
Array
(
[0] => Array
(
[octet1] => 131
[octet2] => 208
[octet3] => 0
[octet4] => 0
)
[1] => Array
(
[octet1] => 141
[octet2] => 128
[octet3] => 0
[octet4] => 0
)
)
With the below foreach I get all ailments how do i concatenate each octent for an array.
foreach($arr as $external)
{
foreach ($external as $octent)
{
echo $octent."<br />";
}
}
The implode function is what you are searching for: