Jump to content

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/69654-solved-coding-xhtml-in-php/
Share on other sites

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?

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?

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.