初学者有关问题 用变量值做变量名

WBOY
Release: 2016-06-13 13:50:11
Original
841 people have browsed it

菜鸟问题 用变量值做变量名

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
<?php $a=1;
$b=2;
$c="LL".$a.$b;
$$c="asdf";
echo $LL12;
?>

Copy after login

我希望生命一个变量
名字是
$LL12
后面的1 和2 是根据ab来的 有没有什么简单的方法可以不用中间变量$c

------解决方案--------------------
PHP code
$a=1;
$b=2;
eval("\$LL$a$b=\"asdf\";");
echo $LL12; <div class="clear">
                 
              
              
        
            </div>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template