Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php-尝试将li添加到当前列表,但未获取li_Php_Html Lists - Fatal编程技术网

Php-尝试将li添加到当前列表,但未获取li

Php-尝试将li添加到当前列表,但未获取li,php,html-lists,Php,Html Lists,试试这个:-更新-快点 <li><a href="index.php" class="first">Home</a></li> <?php if (the_title() == "language-translation") print("<li><a href='become-a-volunteer'>Become a Volunteer</a></l

试试这个:-更新-快点

  <li><a href="index.php" class="first">Home</a></li>
<?php  
        if (the_title() == "language-translation") 
           print("<li><a href='become-a-volunteer'>Become a Volunteer</a></li>");
     ?>
    <li><a href="#"><?php the_title(); ?></a></li>
  • 我得到的只是文本(“成为一名志愿者”),而不是LI项目…(或者是主持人)请原谅,我犯了一个错误。。这在上面仍然不起作用


    无论if是否为真,我都会得到文本,并且永远不会得到LI和A。如果您在if语句的末尾关闭PHP标记,则会得到该文本。移除末端“>”

    if(the_title()=“language translation”)?>

    试试看

    如果(标题()=“语言翻译”)?>
  • 成为一名志愿者
  • 它不起作用的原因是因为在输入print(一个PHP命令)之前结束了PHP