【发布时间】:2013-09-19 19:12:41
【问题描述】:
我需要插入
<?php if (isset($_GET["marke"])) { echo "?marke="; echo $_GET["marke"]; echo "&farbe=gelb"; } else { echo "?farbe=gelb"; } ?>
到一个变量中。
当然
<?php
$var = if (isset($_GET["marke"])) { echo "?marke="; echo $_GET["marke"]; echo "&farbe=gelb"; } else { echo "?farbe=gelb"; }
?>
<?php
echo $var;
?>
不工作 ^^ 正确的代码是什么样的?
【问题讨论】:
-
我不明白您所说的“将
插入变量”是什么意思。你期望输出是什么? -
我要去做了:D
-
我需要等待 8 分钟才能为正确的 cmets 投票
-
if()不是函数,没有返回值。你可以不那样做。