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 Responses to “PHP coding?”

  1. ExO1764 Says:

    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 :

  2. TalentedChimp Says:

    http://www.w3schools.com/
    References :

  3. renga Says:

    <div class="border">
    <?php
    echo "This needs to go into the class border";
    ?>
    </div>
    References :

  4. djprezes Says:

    <?
    echo ‘<div class="border">This needs to go into the class border</div>’;
    ?>
    References :

  5. website hacks Says:

    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 :

RSS Feed