Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/289.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/88.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
在最后一个div中的PHP代码中添加span_Php_Html_Css - Fatal编程技术网

在最后一个div中的PHP代码中添加span

在最后一个div中的PHP代码中添加span,php,html,css,Php,Html,Css,在php中添加Span 最后一个div不工作:( **如何在php代码中添加span** echo" <tr> <td>$id</td> <td>$name</td> <td>$lastname</td> <td>$email</td> <td>$login</td>

在php中添加Span 最后一个div不工作:(

**如何在php代码中添加span**

 echo"
<tr>
        <td>$id</td>
        <td>$name</td>
        <td>$lastname</td>
        <td>$email</td>
        <td>$login</td>
        <td>$password</td>
        <td class="td-actions">
                                                    <a class="btn btn-default btn-xs" href="logout.php">
                                                        <span class="glyphicon glyphicon-pencil"></span> Edit
                                                    </a>
                                                </td>enter code here

 </tr>";
echo”
$id
$name
$lastname
$email
$login
$password
在这里输入代码
";

由于您的
回音使用
指示文本的开始和结束位置,因此您需要使用
\
转义文本本身中的

echo "
<tr>
    <td>$id</td>
    <td>$name</td>
    <td>$lastname</td>
    <td>$email</td>
    <td>$login</td>
    <td>$password</td>
    <td class=\"td-actions\">
        <a class=\"btn btn-default btn-xs\" href=\"logout.php\">
            <span class=\"glyphicon glyphicon-pencil\"></span> Edit
        </a>
    </td>enter code here
</tr>";
echo”
$id
$name
$lastname
$email
$login
$password
在这里输入代码
";

您使用双引号打开PHP字符串,然后过早关闭它,因为您还使用双引号包装HTML属性,请尝试混合它们。我将发布一个示例作为答案。