如何用第一个数组的值替换第二个数组的数组键?PHP替换数组键
$imgNumbers = array();
foreach($imgPat as $imgKey => $imgValue)
{
$imgNumbers[] = intval(substr($imgValue, strrpos($imgValue, '/') +4));
}
$images = array();
foreach($imgPat as $imgKey => $imgValue) {
$images[] = img_to_base64($imgValue);
}
$imgNumbers
返回一个整数像2
,24
或111
。
和$images
应具有阵列密钥$imgNumbers
。