1,105,197 Community Members

Really big HTML and Javascript to PHP variable

Member Avatar
desup
Light Poster
25 posts since Jan 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 5 [?]
Skill Endorsements: 0 [?]
 
0
 

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?

Member Avatar
broj1
Posting Virtuoso
1,576 posts since Jan 2011
Reputation Points: 220 [?]
Q&As Helped to Solve: 219 [?]
Skill Endorsements: 21 [?]
Featured
 
0
 

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.

Question Answered as of 2 Years Ago by broj1
Member Avatar
desup
Light Poster
25 posts since Jan 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 5 [?]
Skill Endorsements: 0 [?]
 
0
 

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

You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: