📜  如何将数组存储在变量php代码示例中

📅  最后修改于: 2022-03-11 14:54:24.398000             🧑  作者: Mango

代码示例3
$something = array(
    'http://www.marleenvanlook.be/admin.php',
    'http://www.marleenvanlook.be/checklogin.php',
    'http://www.marleenvanlook.be/checkupload.php',
    'http://www.marleenvanlook.be/contact.php',
);

foreach($something as $key => $value) {
    $key = 'something' . $key;
    $$key = $value;

    // OR (condensed version)
    // ${"something{$key}"} = $value;
}

echo $something2;
// http://www.marleenvanlook.be/checkupload.php