search

Home  >  Q&A  >  body text

这里字符用双引号 报错! 不可用嘛?

<?php
$str = '苹果很好吃。';
//请将变量$str中的苹果替换成香蕉
$str=str_replace('苹果','香蕉',$str);
echo $str;


小白小白3037 days ago923

reply all(2)I'll reply

  • 数据分析师

    数据分析师2017-09-30 23:34:37

    Use double quotes for characters here. An error will be reported! Not available? -PHP Chinese website Q&A-Double quotation marks are used for characters here. Error! Not available? -PHP Chinese website Q&A

    Please watch and learn.

    reply
    0
  • 迷茫

    迷茫2016-12-22 14:15:23

    在php中单引号和双引号是不同的,如果字符串中包含一些html标签或者css代码,单引号中的字符是按照字符串处理的(也就是忽略其意义),双引号中的标签和css代码则可以正常的发挥它所具有的功能

    reply
    0
  • Cancelreply