Home > php教程 > php手册 > body text

Parse error: syntax error, unexpected T_LNUMBER

WBOY
Release: 2016-05-25 16:53:02
Original
2021 people have browsed it

Parse error: syntax error, unexpected T_LNUMBER

<?php 
//首先你的变量赋值有问题,在没有进行str_replace()的时候就会报错 
$a = &#39;"女老师竭力向孩子们证明,<span>学习好功课的重要性女老师竭<a href="1">2222222222</a>力向孩子们&#39;证明&#39;,学习好功课的重要性女老师竭力向孩子们证明,学习好功课的重要性女老师竭力向孩子们证明,学习好功课的重要性女老师竭力向孩子们证明,学习好功课的重要性女老师竭力向孩子们证明"&#39;; 
echo str_replace("","\"",$a)
Copy after login

失败,提示 $a=""; 错误 Parse error: syntax error, unexpected T_LNUMBER

正确方法

方法一:echo str_replace(array('"',"'","‘","’"),"",$a);

方法二:str_replace("'"\"","",$a)

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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template