The JavaScript implementation stores an example of an HTML string

  • 2020-03-30 02:39:51
  • OfStack

I'm in PHP. It reminds me. < < Syntax (heredoc and nowdoc), so name him heredoc.
Function.prototype.heredoc = function(){ 
//The function annotation is used to store strings without escaping.
var _str = this.toString(), 
s_pos = _str.indexOf(""); 
return (s_pos<0 || e_pos<0) ? "" : _str.substring(s_pos, e_pos); 

function fn(){ 
<td> The user name </td> 
<td> password </td> 
<td style="widht:20px;">@name</td> 

var str_table = fn.heredoc(); 

Related articles: