Home > Backend Development > PHP Tutorial > PHP语句,多重引号问题

PHP语句,多重引号问题

WBOY
Release: 2016-06-23 14:00:52
Original
1905 people have browsed it

双引号里面有单引号,单引号里面还需要引号怎么办?
echo   "";  onclick里面的单引号里面还要加引号,怎么办


回复讨论(解决方案)

有多重解决方案
1. 转义
2. 拼接符。就是 .号
3.heredoc语法。

$a = '1';echo '<input type="button" value="完成" onclick="trunTo(\''.$a.'\')"/>';echo "<input type='button' value='完成' onclick='trunTo(\"".$a."\")'/>";
Copy after login

echo   "<input type='button'  class='btnStyle' name='button' id='sbutton' onclick=\"location.href='__URL__/edit?id={$s.uid}&'\" value='完成'/>";
Copy after login
 

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template