php string escaping like python's “”“ ”“”?

前端 未结 3 943
Happy的楠姐
Happy的楠姐 2021-01-20 11:32

Hi I was wondering if there is an easy way to escape strings in php.

In python I use \"\"\" \"\"\", and everything between there is escaped. so when using special c

3条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-20 11:47

    Which are the characters do you have to escape?

    You could use single quotes [docs]. The only characters that have to be escaped in such a string are \ and '.

    If you have a long string, also have a look at heredoc [docs].

提交回复
热议问题