Jump to content

Generate HTML through PHP


nagalenoj

Recommended Posts

Dear friends,

    Is there any module available in php to create html elements. I don't know much about HTML. So, Using php i would like to create elements.

 

For example,

Calling a function like the following will create a p tag with the given attributes.

Create_p("class","id","name")

Link to comment
https://forums.phpfreaks.com/topic/149221-generate-html-through-php/
Share on other sites

just found this on the web

http://phphtmltemplate.sourceforge.net/

 

I think this is more or less what you are looking for...

 

otherwise, you can also generate a HTML file by using the XMLWriter class

 

but... I think it would be easier to just learn the basics of HTML... as it is rather easy

I'm not sure exactly what you are looking to achieve, but to write HTML using PHP you could use the ECHO command.

 

Something like  (BTW this was written up on the quick, not tested !)

 

 

function create_p('$class','$id','$name') {

echo "<P NAME = '$name' ID = '$id' CLASS = '$class'>";

}

 

Or something like that !  A more experienced programmer might spot a syntax error in the above, like I say I haven't tested it.

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.