ホームページ >バックエンド開発 >PHPチュートリアル >変数を動的に作成する方法
変数を動的に作成する方法を教えてください
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> Array ( [0] => 65 [1] => 66 [2] => 71 [3] => 73 [65] => Array ( [$_65] => 0 ) [66] => Array ( [$_66] => 0 ) [71] => Array ( [$_71] => 0 ) [73] => Array ( [$_73] => 1 ) )
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> Array ( [0] => 65 [1] => 66 [65] => Array ( [$_65] => 0 ) [66] => Array ( [$_66] => 0 ) )
$ar=配列 ( '0' => 65 、 '1' => 66 、 '65' => 配列 ( '$_65' => 0 ) 、 '66' => 配列 ( '$_66' => 0 ) ) ; foreach($ar as $v){ if(is_array($v)){ foreach($v as $kl=>$vl) eval("$kl=$vl;"); } } var_dump($_65,$_66); //int(0) int(0) <div class="clear"></div>