刀乐林_个人页

个人头像照片 刀乐林
0
2
0

个人介绍

暂无个人介绍

擅长的技术

获得更多能力
通用技术能力:

暂时未有相关通用技术能力~

云产品技术能力:

暂时未有相关云产品技术能力~

阿里云技能认证

详细说明
暂无更多信息
正在加载, 请稍后...
暂无更多信息
  • 回答了问题 2019-07-17

    PHP 字符串中的Heredoc 和 Nowdoc 结构,如何使用?

    首先要了解下定界符
    php可以使用

    <?php
    echo <<<EOT
    this is body
    this is body as well
    EOT
    ;

    这种方式来输出大段文字,其中EOT就是定界符,定界符有分为开始定界符和结束定界符,定界符可以是任何内容,只要保证开始定界符和结束定界符一致就行,比如

    <?php
    echo <<<AAA
    this is body
    this is body as well
    AAA
    ;

    这就是heredoc的写法,heredoc中的变量会被解析成具体的值

    <?php
    $a = 'this is string';
    echo <<<AAA
    this is body
    this is body as well
    $a
    AAA
    ;
    // output
    this is body
    this is body as well
    this is string

    如果希望内容不被解析,可以在开始定界符的两边加上单引号'EOT'

    <?php
    $a = 'this is string';
    echo <<<'AAA'
    this is body
    this is body as well
    $a
    AAA
    ;
    // output
    this is body
    this is body as well
    $a

    这就是nowdoc的写法

    踩0 评论0
  • 回答了问题 2019-07-17

    PHP环境如何安装

    问题要描述清楚呀
    服务器是否安装了服务环境?如apache nginx
    服务器是否能解析php?
    源码是否上传到正确的目录下?
    打不开是报错了还是?

    踩0 评论0
正在加载, 请稍后...
滑动查看更多
正在加载, 请稍后...
暂无更多信息