Forum Moderators: coopster

Message Too Old, No Replies

Commenting Out PHP & HTML

         

PaulPA

1:33 pm on May 8, 2005 (gmt 0)

10+ Year Member



I'm working with a CMS script that mixes HTML and PHP and I need to comment out both contained within a function. Is there a way to comment out both at the same time? I know how to comment out for PHP and for HTML but I'm not sure if it is possible to use one method that will comment out both.

isorg

2:10 pm on May 8, 2005 (gmt 0)

10+ Year Member



Do you mean like this:

<?php

//this is a PHP comment

//<!-- and this is a HTML comment -->

?>

PaulPA

5:39 pm on May 8, 2005 (gmt 0)

10+ Year Member



Well looking more for something that will comment out something like this with a single code rather than having to use BOTH separate php and html coding. Thanks.

<ul>
<?php
foreach ( $abc as $ab ) {
if ( $cde == $ab->cde ) {
?>
<li>
<b>
<?php echo $ac->name;?>
</b>
</li>
</ul>

dcrombie

12:35 pm on May 9, 2005 (gmt 0)



<?PHP 
/*
(your PHP and HTML code here)
*/
?>

;)

PaulPA

4:56 pm on May 9, 2005 (gmt 0)

10+ Year Member



Right - know that one will work if the PHP and HTML is inside the <?php?> tag but the script I'm using doesn't follow that method. See my example. HTML is not inside PHP.

jatar_k

5:10 pm on May 9, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



>> with a single code rather than having to use BOTH separate php and html coding

not possible unless they are all in php or all html, otherwise you need both

PaulPA

8:11 pm on May 9, 2005 (gmt 0)

10+ Year Member



Thanks - assumed as much but was hoping others might know a way.