zoukankan      html  css  js  c++  java
  • PHP中的字符串类型

    PHP支持两种类型的字符串,这些字符串用引号说明。


    1.如果希望赋值一个字面意义的字符串,精确保存这个字符串的内容,应该用单引号标注,例如:
    1. 1 $info='You are my $sunshine';
      2 echo $info;
    此时会显示You are my $sunshine,单引号中的每个字符都赋值给变量$info。
     
    2.当字符串中包含一个变量时,可以使用双引号标注字符串,例如:
    1. $sunshine='apple of my eyes';
      $info="You are my $sunshine";
      echo $info;
    此时PHP会替换变量的内容,则会显示You are my apple of my eyes
  • 相关阅读:
    【LibreOJ】#6257. 「CodePlus 2017 12 月赛」可做题2
    【Atcoer】ARC088 E
    【Atcoder】ARC088 D
    【CodeForces】671 D. Roads in Yusland
    【CodeForces】671 B. Robin Hood
    【CodeForces】671 C. Ultimate Weirdness of an Array
    【CodeForces】679 A. Bear and Prime 100
    【CodeForces】679 B. Bear and Tower of Cubes
    【BZOJ】3262: 陌上花开
    【CodeForces】899 F. Letters Removing
  • 原文地址:https://www.cnblogs.com/wixy/p/5413972.html
Copyright © 2011-2022 走看看