php two array combine with array index and array value merage in a single array
<?php
function getmutinarrow($str)
{
$arraymurit=explode('(',$str);
$arrayesub=array();
$outarray=array();
$countkey=0;
foreach($arraymurit as $extrachmuti){
$arrayesub=explode('|',$extrachmuti);
foreach($arrayesub as $value){
$crlean=str_replace(')','',$value);
$outarray[]=$crlean;
}
$countkey=$countkey+1;
}
return $outarray;
}
$arrayget=getmutinarrow('(Price%20range|price_range_1038_2039,price_range_37_1038,abu)(Brand|baby_jogger,dream_on_me,baris)');
$vlcounter=0;
$temparray=array();
foreach($arrayget as $extrctnarrowval)
{
if($vlcounter%2==0){
$temparray[]=$extrctnarrowval;
}else{
$narrow[]=$extrctnarrowval;
}
$vlcounter=$vlcounter+1;
}
array_shift($temparray);
echo "<pre>";print_r(array_combine($narrow,$temparray));
?>
<?php
function getmutinarrow($str)
{
$arraymurit=explode('(',$str);
$arrayesub=array();
$outarray=array();
$countkey=0;
foreach($arraymurit as $extrachmuti){
$arrayesub=explode('|',$extrachmuti);
foreach($arrayesub as $value){
$crlean=str_replace(')','',$value);
$outarray[]=$crlean;
}
$countkey=$countkey+1;
}
return $outarray;
}
$arrayget=getmutinarrow('(Price%20range|price_range_1038_2039,price_range_37_1038,abu)(Brand|baby_jogger,dream_on_me,baris)');
$vlcounter=0;
$temparray=array();
foreach($arrayget as $extrctnarrowval)
{
if($vlcounter%2==0){
$temparray[]=$extrctnarrowval;
}else{
$narrow[]=$extrctnarrowval;
}
$vlcounter=$vlcounter+1;
}
array_shift($temparray);
echo "<pre>";print_r(array_combine($narrow,$temparray));
?>