answersLogoWhite

0

How do you leave comment on php code?

Updated: 10/18/2022
User Avatar

Wiki User

13y ago

Best Answer

There are 3 styles of PHP comments

// comment a single line

# comment a single line (perl-style

/*

comment block

*/

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you leave comment on php code?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Can HTML tags code and text be included in a php code?

Yep. We do it all the time. One way is to simply tell PHP that you want the tags echoed. Like so: <?php echo('<b>Hi</b> Nice to meet you!'); ?> Sometimes you want instead to simply use the PHP in parts of a page and leave the rest. You can do this, too. <body> <div class="login"> <?php if($user->loggedIn()){ ?> <b>Hi!</b> <?php }else{ ?> <!-- HTML FORM HERE --> <?php } ?> </div> </body>


How do you create an area of a webpage to display PHP results?

PHP code blocks start with <?php and end with ?>.


Why you do not see any PHP code when you view the source code of a PHP page in the browser?

PHP is server-side, the browser itself does not interpret it. Rather, the browser sends a query to the server, and the PHP scripting generates custom HTML document. It is this HTML that you are seeing the source code of.


How do you embed PHP code in C code?

PHP and C are two different programming languages that cannot directly interact with eachother. You can have a program made with C call a PHP script, using its output (an indirect interaction), but there's no way to "embed" PHP into C code.


How is PHP code designated in a webpage?

PHP code is never executed by the web browser, and the source code of a PHP file will normally not be sent to the browser at all. In this sense, there is no designation of PHP code on the client's side-- it all appears to be HTML, text, XML, or whatever other type of output you choose to produce. On the server side, PHP scripts are inside of files ending in ".php". Script inside of these PHP files start with . Anything outside of these tags will be sent to the browser as static ("unchanging") output. The code inside the PHP tags start from the top, and are executed sequentially from top to bottom, unless flow control is used to modify the control of the scripts (such as functions, while loops, switch and if constructs, etc).

Related questions

How do you add a comment in PHP?

< ?php // This is an example of comment in PHP /* This is another example of comment in PHP and we can write comments in multiple lines using this method */ ? >


How do you comment in PHP?

$this is not a comment;//this is a comment/*this is alsoacomment */


What is syntax in php?

We can use php tags in different ways. <?php //php code to be written here ?> OR <? //php code ?> This tag will not work when we using editors such as macromedia dreamweaver. OR < script language="php"> //php code </script>


How do you put comment statement in php?

For one line comment // Your one-line comment here For multi line comments /* * Multi-line comments here * some explanation * @author The author of the code * @version The version of the code * @date The date code was written * @params The parameters of the code * @return What is returned. For eg. a string, a number or a boolean */ Not everything written is multi-line is essential. Just write a comment in way that you and people who see your code in the future understand what that piece of code does


What is a correct way to add a comment in PHP?

There are many ways to comment in PHP, all of them valid: /* Classic C style, which allows you to comment blocks rather than single lines */ // C++ Style, which remarks the remainder of a single line # bash style, which also is a rest-of-the-line comment


How do you make a comments page on dreamweaver?

You'd need PHP and mySQL knowledge for this. Search Google for "Free PHP Comment Scripts".


Can HTML tags code and text be included in a php code?

Yep. We do it all the time. One way is to simply tell PHP that you want the tags echoed. Like so: <?php echo('<b>Hi</b> Nice to meet you!'); ?> Sometimes you want instead to simply use the PHP in parts of a page and leave the rest. You can do this, too. <body> <div class="login"> <?php if($user->loggedIn()){ ?> <b>Hi!</b> <?php }else{ ?> <!-- HTML FORM HERE --> <?php } ?> </div> </body>


How do you change the language code in a PHP page?

I have little idea of your question however <?php #code in here ?> is the starter for PHP, and then anything outside is HTML.


How do you create an area of a webpage to display PHP results?

PHP code blocks start with <?php and end with ?>.


What file extension is used to save a php file after code has been written into it?

The file extension for PHP is .php


Why you do not see any PHP code when you view the source code of a PHP page in the browser?

PHP is server-side, the browser itself does not interpret it. Rather, the browser sends a query to the server, and the PHP scripting generates custom HTML document. It is this HTML that you are seeing the source code of.


How do you embed PHP code in C code?

PHP and C are two different programming languages that cannot directly interact with eachother. You can have a program made with C call a PHP script, using its output (an indirect interaction), but there's no way to "embed" PHP into C code.