Home > php教程 > php手册 > php中动态变量用法实例

php中动态变量用法实例

WBOY
Release: 2016-06-06 20:03:28
Original
1046 people have browsed it

这篇文章主要介绍了php中动态变量用法,实例分析了php中动态变量的相关使用技巧,需要的朋友可以参考下

本文实例讲述了php中动态变量用法。分享给大家供大家参考。具体分析如下:

定义的固定变量:

$my_pic_1=$row["pic_1"]; $my_pic_2=$row["pic_2"]; $my_pic_3=$row["pic_3"]; $my_pic_4=$row["pic_4"]; $my_pic_5=$row["pic_5"]; $my_pic_6=$row["pic_6"]; $my_pic_7=$row["pic_7"]; $my_pic_8=$row["pic_8"];

这里我们用循环语句把每个变量的值全部输出来:

这样输出

肯定是不行的。
 
查询php动态变量用法后改成

希望本文所述对大家的php程序设计有所帮助。

Related labels:
php
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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template