koolade Posted September 17, 2007 Share Posted September 17, 2007 I was wondering what the correct way to integrate xhtml into php? Do you design you your entire site with the xhtml inside of php or only embed the xhtml in php when necessary? For instance would you put your entire xhtml output and php with in a variable and echo it out all at once. Or does it really depend on the situation? Quote Link to comment https://forums.phpfreaks.com/topic/69654-solved-coding-xhtml-in-php/ Share on other sites More sharing options...
BlueSkyIS Posted September 17, 2007 Share Posted September 17, 2007 depends on the situation. I would put PHP into XHTML more often than the other way around. Quote Link to comment https://forums.phpfreaks.com/topic/69654-solved-coding-xhtml-in-php/#findComment-349978 Share on other sites More sharing options...
koolade Posted September 17, 2007 Author Share Posted September 17, 2007 thanks alot! Question that has been bugging me alot. Quote Link to comment https://forums.phpfreaks.com/topic/69654-solved-coding-xhtml-in-php/#findComment-349981 Share on other sites More sharing options...
freakstyle Posted September 17, 2007 Share Posted September 17, 2007 I'll second that! html is for presentation, which should be outside of PHP as much as possible. Quote Link to comment https://forums.phpfreaks.com/topic/69654-solved-coding-xhtml-in-php/#findComment-349993 Share on other sites More sharing options...
koolade Posted September 17, 2007 Author Share Posted September 17, 2007 Well i couldn't find an answer on google so I searched php forums signed up and thought I'd ask. I mean if you're in a loop no point in getting out of php just to do an xhtml tag but doesn't jumping in and out of php use more cpu cycles on the server or am I mistaken? Quote Link to comment https://forums.phpfreaks.com/topic/69654-solved-coding-xhtml-in-php/#findComment-350010 Share on other sites More sharing options...
sKunKbad Posted September 17, 2007 Share Posted September 17, 2007 You would make a lot of work for yourself echoing all the output. Quote Link to comment https://forums.phpfreaks.com/topic/69654-solved-coding-xhtml-in-php/#findComment-350044 Share on other sites More sharing options...
koolade Posted September 17, 2007 Author Share Posted September 17, 2007 it'd actually just one echo reusing the same variable. for instance $out = "<body>"; $out .="content etc"; echo $out; but yea i hear ya thats why im asking if anybody here does it like that and if there are any benefits to it does it process faster cost less bandwidth? anything? Quote Link to comment https://forums.phpfreaks.com/topic/69654-solved-coding-xhtml-in-php/#findComment-350055 Share on other sites More sharing options...
cooldude832 Posted September 17, 2007 Share Posted September 17, 2007 that operator is really not designed for that sort of function the .= by design was for generating a code or stringing together a simple sentence. Also My vote is for making a strucutral design completely free of PHP then simply adding it in ass needed inside the framework of xhtml. As for compliance issues it doesn't really matter because PHP outputs before xhhtml is viewed so it will always be compliant if the output is valid. Quote Link to comment https://forums.phpfreaks.com/topic/69654-solved-coding-xhtml-in-php/#findComment-350058 Share on other sites More sharing options...
koolade Posted September 17, 2007 Author Share Posted September 17, 2007 sounds pretty definitive to me thanks. topic solved. Quote Link to comment https://forums.phpfreaks.com/topic/69654-solved-coding-xhtml-in-php/#findComment-350129 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.