dpsyssiv90846 2016-09-14 10:33
浏览 41
已采纳

PHP字符串运算符 - 与Function()结合使用

I would like to combine the usage of a function(), and echo it with a string operator.

The reason for this usage is that I'm building a html/php form what contains multiple pull down menus, where only the name is different. And I use the string operator for my SQL query with while/if/else statements.

Function:

function telling($setname) 
    {
        echo "<select name=".$setname.">";
        foreach (range(0, 35) as $number) 
        {               
                echo "<option value=".$number.">".$number."</option>
";  
        }
        echo "</select>";
    }

And for the output:

$output "";
$output .= "<form>";
telling("set1_1");
$output .= "  -  ";
telling("set1_2");
....
$output .= "</form>";
echo $output;

I do get the pulldown menu on the site, but on a different part on the site as intended. Do you guys know how to combine my methods.

  • 写回答

1条回答

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥15 JS如何把上面这种数据类型转换成下面这种的
      • ¥15 ubuntu 16.04.2 oss上传文件并显示耗时
      • ¥15 存储过程调用没有进行逻辑计算
      • ¥15 R语言数据分析的相关问题
      • ¥15 模型导入SP后贴图纹理只有一个,拆了四张UV的,怎么解决?
      • ¥15 检索带order by 非常慢
      • ¥20 python 爬虫 token 加密方式
      • ¥20 IAR环境报错reading CPU status failed
      • ¥20 Python如何读取指定播放设备的音频帧?
      • ¥15 用dnspy修改游戏数据报错