PHP coding?
February 1st, 2010 by admin
How do you use div class’ in php such that you can attach html generated by php into that div class. Example
<html>
<head>
</head>
<body>
<div class=”border”>
</div>
<?php
echo “This needs to go into the class border”
?>
</body>
</html>
Yeh you sort of understand but within that php script there is lots of other code and html generated that i dont want encompassed in the border div….so what im trying to ask is if it is poswible to define the echo statement inside a div inside php if that makes sense
That didn’t really make sense.
Is this what you’re looking for?:
<html>
<head>
</head>
<body>
<div class=”border”>
<?php
echo “This needs to go into the class border”
?>
</div>
</body>
</html>
- 5 Comments »
- Posted in PHP Coding

I’m not sure what you mean. Do you mean like this:
<html>
<head>
</head>
<body>
<div class="border">
<?php
echo "This needs to go into the class border";
?>
</div>
</body>
</html>
This would output "This needs to go into the class border" within the div.border rule.
References :
http://www.w3schools.com/
References :
<div class="border">
<?php
echo "This needs to go into the class border";
?>
</div>
References :
<?
echo ‘<div class="border">This needs to go into the class border</div>’;
?>
References :
That didn’t really make sense.
Is this what you’re looking for?:
<html>
<head>
</head>
<body>
<div class="border">
<?php
echo "This needs to go into the class border"
?>
</div>
</body>
</html>
References :