Skip to content
Advertisement

sprintf argument swapping and HEREDOC

I’m trying to use sprintf on a heredoc this way. It wont work. Any idea how to solve this?

JavaScript

Notice: Undefined variable: s in

Advertisement

Answer

Because HEREDOC acts like a double-quoted string, PHP is attempting to interpolate the $s as a variable. Try NOWDOC instead

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement