Print newline in PHP in single quotes

前端 未结 12 1284
野性不改
野性不改 2020-11-28 21:33

I try to use single quotes as much as possible and I\'ve noticed that I can\'t use \\n in single quotes. I know I can just enter a newline literally by pressing return, but

12条回答
  •  粉色の甜心
    2020-11-28 22:09

    in case you have a variable :

    $your_var = 'declare your var';
    echo 'i want to show my var here'.$your_var.'
    ';

提交回复
热议问题