phpcodeaddict Posted December 15, 2008 Share Posted December 15, 2008 PHP newbie question I have some HTML with a div tag and i want to be able to use PHP to create the contents of the div tag. E.g. My HTML is; <div id="bodyHTML">Insert main body HTML here</div> And i want to use PHP to get access that div by the id and then replace the 'Insert main body HTML here' with some HTML generated from my PHP script Can anyone tell me how i can do this in PHP? Thanks Link to comment https://forums.phpfreaks.com/topic/136998-modifying-contents-of-an-html-div-tag/ Share on other sites More sharing options...
DarkerAngel Posted December 15, 2008 Share Posted December 15, 2008 I'm not sure what exactly you are trying to achieve bout it sounds like you might want to use javascript. That is if you want to edit the contents of the DIV based on the id tag alone. You could so something like: <div id="bodyHTML"><?=$bodyHTML ?></div> but that don't sound to me what you are trying to do. More information would help. Link to comment https://forums.phpfreaks.com/topic/136998-modifying-contents-of-an-html-div-tag/#findComment-715615 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.