Disclosure: We are a professional review site that receives compensation from the companies whose products we review. We test each product thoroughly and give high marks to only the very best. We are independently owned and the opinions expressed here are our own.
At one time or another, every blogger using WordPress will come across an issue with a plugin or theme that is causing errors. If a bloggers wants to fix these types of issues they need to learn PHP to make any database coded changes to the system. Lately, I have been going through my plugins, and fixing poorly coded plugins and adding new features through pieces of code that I found or had someone create for me. Just playing with the code has taught me a couple of things and one of those that I need to go back relearn PHP the other is that commenting out PHP code can be helpful if you temporarily want to block code from running during testing.
Types of PHP Comments
There are two types of comments you can use with PHP. Those are, single comment, and mult-iline commenting
Single Line Comments:
Single line comments tells the interpreter to block everything that is on same line to the right of the comment. You can use “//” or “#” and everything after after the comment will be ignored.
Code example:
<?php
echo “Hello World!”; // This will print out Hello World!
echo “<br />Can you see the comments?”; // echo “I bet you can”;
// echo “Hello world.!”;
# echo “you can use the hash tag to remove lines of code as well”;
# echo “are you sure you can see me?”
?>
Printed Code:
Hello World!
Can you see the comments?
Multiple Line Comment
Muli-line PHP comments are used to write multiple line comments. It can also be used comment out large blocks of code. Use the multi-line comment and place “/* at the beginning of code you want to block off. Then place “*/” at the end of code needing to be blocked off. This is what it should look like.
Code Example:
<?php
/* Message goes here. */
echo “Hello World!”;
/* echo “Can see me?”; echo “No?”; */
?>
Printed Code:
Hello World!
Recommendations: When to Use Comments
All though my experience with PHP is very limited, I recommend that you always use comments when you can. But don’t go overboard. Use it when you add extra code or if there is a very complicated piece of code you are working. Its always good to have a comment or two about what you are trying to do or what its suppose to do. This can not only be helpful to you in the future if you need to make changes, but if you ever have to hand your site over to a PHP developer to work on your site, he or she has an idea what you did.
[url=http://my.curse.com/members/Kally1.aspx]KENDRA WILKINSON UNCENSORED[/url]
[url=http://my.curse.com/members/Kally1.aspx]KENDRA WILKINSON UNCENSORED[/url]
[url=http://my.curse.com/members/Olly13.aspx]KIM KARDASHIAN BLOWJOB[/url]
[url=http://my.curse.com/members/Olly13.aspx]KIM KARDASHIAN BLOWJOB[/url]
[url=http://my.curse.com/members/SandlerOk1984.aspx]LINDSAY LOHAN FAKES[/url]
[url=http://my.curse.com/members/SandlerOk1984.aspx]LINDSAY LOHAN FAKES[/url]
[url=http://my.curse.com/members/Roling1989.aspx]MEGAN FOX CAMEL TOE[/url]
[url=http://my.curse.com/members/Roling1989.aspx]MEGAN FOX CAMEL TOE[/url]
[url=http://my.curse.com/members/alexxx1982.aspx]MEGAN FOX DESNUDA[/url]
[url=http://my.curse.com/members/alexxx1982.aspx]MEGAN FOX DESNUDA[/url]