need a theoretical hint - how is this method of introducing css and / or javascript properly called

$js = <<< JS ... your JS code here JS; $css = <<< CSS ... your CSS styles here } CSS; 

I mean three opening angle brackets

  • four
  • @Kromster, I think it is not quite correct to edit - Grundy
  • Where do you see such code? - Grundy
  • @Grundy see it in php code - buyboy
  • one
    @PinkTux You misunderstood me. :) I know about the heredoc syntax. I even used it myself. But for the first time I see the assignment of a css or js code to a php variable. This will be especially strange if my guess that this is for his subsequent withdrawal is confirmed. :) - intro94

1 answer 1

It depends on what goals you are pursuing. If you dynamically generate pdf files, then this method accepts, but if there is a way to avoid storing HTML, etc. in a change then use it immediately.

  • And how does this relate to the question? If you use the "right", then heredoc, and if the "wrong" - as we call? Yes, and so, note: the way the variables are stored is chosen by the author of the code, not you. - PinkTux
  • Here heredoc was voiced. I think there was enough information about this. I think enough information was about that. I meant the following - You don’t have to mix PHP code with HTML and others. It’s necessary to separate them, there are lots of ways. And for your information, I’ll add that the author runs the same style again, but there are good tone rules - Vanya Avchyan