对于例>内容=树返回的特殊内容,以树建立一个属性是否
含量为>的index.php内容=树
<?php
if (<?= $_GET['content'] ?> == tree) {
echo "text here";
}
else {
echo "nothing to see here";
}
?>
对于例>内容=树返回的特殊内容,以树建立一个属性是否
含量为>的index.php内容=树
<?php
if (<?= $_GET['content'] ?> == tree) {
echo "text here";
}
else {
echo "nothing to see here";
}
?>
首先,我建议你检查的PHP的手动功能和其他的PHP代码,这里有一个例子的,如果/ ELSEIF/else语句:link
现在,在你的代码,你这样做:if (<?= $_GET['content'] ?> == tree) {
注意你怎么叫php echo <?= $_GET['content'] ?> == tree
作为一个条件,首先出现错误,因为你不能调用php作为条件,更不用说回声了。 你这是怎么应该写的代码:
<?php
if ($_GET['content'] == 'tree') {
echo "text here";
}
else {
echo "nothing to see here";
}
?>
请看看我给你的链接。
搞掂:
<?php
if (isset($_GET['content']) && $_GET['content'] == 'tree') {
echo "text here";
}
else {
echo "nothing to see here";
}
?>
倍数:
<?php
if (isset($_GET['content']) && in_array($_GET['content'], array('tree', 'bird', 'fish', 'taco'))) {
echo "text here";
}
else {
echo "nothing to see here";
}
?>
删除此标签:''=' and '?>也把像' “树” 引号''tree'是 – Rizier123 2014-12-06 16:08:51
它的JavaScript或PHP? – GolezTrol 2014-12-06 16:10:39