Try with array_combine() and then use foreach() to make dynamic variables. array_combine()- Creates an array by using one array for keys and another for its values
<?php
$arra = array('one', 'two', 'five', 'seven');
$arrb = array('black', 'white', 'gold', 'silver');
$result = array_combine($arra, $arrb);
foreach($result as $key=>$value){
${$key} = $value;
}
echo $two;
?>
DEMO: https://3v4l.org/VPNQh
OR use extract() after combining $arra and $arrb. extracts()-
Imports variables into the current symbol table from an array.
<?php
$arra = array('one', 'two', 'five', 'seven');
$arrb = array('black', 'white', 'gold', 'silver');
$result = array_combine($arra, $arrb);
extract($result, EXTR_PREFIX_SAME,'');
echo "$one, $two, $five, $seven";
?>
DEMO: https://3v4l.org/VW55k