Split the two groups of data into strings separated by "," (& nbsp; [0] & nbsp ;=& gt; & nbsp; array & nbsp; (& nbsp; & nbs split the two groups of data into strings as ", separate
Array
(
[0] => Array
(
[Mobile] = & gt; 13814002394
)
[1] => Array
(
[Mobile] = & gt; 13814002395
)
[2] => Array
(
[Mobile] = & gt; 13814002396
)
[3] => Array
(
[Mobile] = & gt; 13814002397
)
[4] => Array
(
[Mobile] = & gt; 13814002398
)
[5] => Array
(
[Mobile] = & gt; 13814002399
)
[6] => Array
(
[Mobile] = & gt; 13814002400
)
)
This is a two-group array. I want to split it into strings $ mobile = 13814002399,13814002400, 13814002398;
This is only the form
------ Solution --------------------
$array=array(
'0'=>array('mobile'=>'13814002394'),
'1'=>array('mobile'=>'13814002395'),
'2'=>array('mobile'=>'13814002396'),
'3'=>array('mobile'=>'13814002397'),
'4'=>array('mobile'=>'13814002398'),
'5'=>array('mobile'=>'13814002399'),
'6'=>array('mobile'=>'13814002400')
);
foreach($array as $key=>$value){
$mobile.=$dot.$value['mobile'];
$dot=",";
}
return $mobile;
------ Solution --------------------
$array=array(
'0'=>array('mobile'=>'13814002394'),
'1'=>array('mobile'=>'13814002395'),
'2'=>array('mobile'=>'13814002396'),
'3'=>array('mobile'=>'13814002397'),
'4'=>array('mobile'=>'13814002398'),
'5'=>array('mobile'=>'13814002399'),
'6'=>array('mobile'=>'13814002400')
);
foreach($array as $key=>$value){
$newarray[$key]=$value['mobile'];
}
return join(",",$newarray);