Hello, ths is one thing that is really shaking my heade O_o, I have got a Html and Javascript code, that contains about 1000 lines and I need to put it to php variable.
Sure I was thinking about the EOT method, But thare is one problem with it, if there is word function like in javascript is, it will take it like php function, and this will cause errors.
Any other Idea how to do it?

Re: Really big HTML and Javascript to PHP variable 80 80

You can use nowdoc syntax (requires PHP 5.3):

http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.nowdoc

Please note that variables will not get parsed.

You could also use a heredoc syntax but I am really not sure whether function keyword gets parsed or not.

Re: Really big HTML and Javascript to PHP variable 80 80

Yes, I have already found a way using file_get_contents :) but thank you

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.