我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

如何使用数组作为变量?

i want to use an array as a variable

this is the array

    Array
    (
        [code] => Ty7nB
        [image_src] => /captcha/simple-php-captcha-master/simple-php-captcha.php?_CAPTCHA&t=0.42191900+1410018068
    )

and the variable $code must be the [code] of the array for example :

    <?php
     echo 'Your code is '.$code;
    ?>

the result must be

    Your code is Ty7nB
<?php
 echo 'Your code is '.$array['code'];
?>

See the manual for working with arrays as this is basic PHP.

You need this:

<?php
 echo 'Your code is '.$array['code'];
?>

近期文章

  • 登录不起作用 - 注册工作正常
  • 如何注册1个月计划的用户? [关闭]
  • 从另一个函数中调用函数[关闭]
  • PHP If语句不重定向空字符串
  • php使用preg_match在href标签内获取2个字符串
  • php javascript在每个页面上打印特定的页脚
  • 如何运行存储在MySQL数据库中的PHP unlink命令[关闭]
  • 在PHP中格式化数组作为示例中给出的必需输出[关闭]
  • 如何在php中正确包含cronjobs和正常执行的文件
  • 数据库帮助/查询[关闭]
  • 到达时间[关闭]
  • PHP中的PHP变量? [重复]
  • 为什么不|| 工作? [关闭]
  • 在PHP中选择语句[关闭]
  • MYSQL - 用户数据库设置
  • 使用URL栏预填表单
  • PHP中的上一个/下一个按钮
  • 使用PHP和MySQL安全登录[关闭]
  • 使用MySQL结果和PHP编码'帮助'[关闭]
  • 放置Cookie以防止重新访问网站[关闭]

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华