PHP

PHP 数据类型

2020-04-24  本文已影响0人  887d1fc86fe6

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <?php
    $n1 = 123;
    $n2 = 0123;
    $n3 = 0x123;
    $n4 = 0b1010;

    echo $n1;
    echo '<br>'.$n2;
    echo '<br>'.$n3;
    echo '<br>'.$n4;
  ?>
</body>
</html>



<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <?php
  $n1 = 10;
  echo '单引号n1的值为:', $n1;
  echo '<br>单引号n1的值为:$n1';
  echo "<br>双引号n1的值为:$n1";
  ?>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <?php
  $n1 = 10;
  echo '单引号n1的值为:', $n1;
  echo '<br>单引号n1的值为:$n1';
  echo "<br>双引号n1的值为:$n1";
  echo "<br>双引号n1的值为:$n1";
  echo "<br>$n1双引号n1的值为:$n1";
  echo "<br>\$n1双引号n1的值为:$n1";
  ?>
</body>
</html>

它会高亮起来当做对象检测的,一运行就会报错:

上一篇下一篇

猜你喜欢

热点阅读