cashpath
03-08-2007, 06:53 PM
as a PHP newb I have a simple php question.
When you are inserting html code into your PHP document what is the best way to do it?
SHould you
1) leave php whenever you can? Like >? HTML CODE <?
2) or should you echo or ptint your html like
print " HTML code with a value=\"value\"";
The main reason I am asking is because you are supposed to put quotes around all values in html. SO I guess the real question is what is the best way to hanlde the quotes around the values?
Is it to escape the php? Or to backslash the quote tags EVERY TIME or is there an easier solution?
************************************************** ************************
UPDATE: I think I have found the answer for this. use single quotes on print statements... if this is not the best way let me know.
Thanks
When you are inserting html code into your PHP document what is the best way to do it?
SHould you
1) leave php whenever you can? Like >? HTML CODE <?
2) or should you echo or ptint your html like
print " HTML code with a value=\"value\"";
The main reason I am asking is because you are supposed to put quotes around all values in html. SO I guess the real question is what is the best way to hanlde the quotes around the values?
Is it to escape the php? Or to backslash the quote tags EVERY TIME or is there an easier solution?
************************************************** ************************
UPDATE: I think I have found the answer for this. use single quotes on print statements... if this is not the best way let me know.
Thanks