15 Feb 2013, 16:38
Reply
Reply with Quote
Like (0)
#1
Join Date:
Jan 2007
Posts:
417
Plugin Contributions:
0
Add a personal note in a php file
Hi,
I'd simply (and cleanly) like to add a personal note when I attempt to edit a php file.
Eg.
// "I added the below code when trying to install xsell module"
[COLOR=#007700]require( $template -> get_template_dir ( 'tpl_modules_xsell_products.php' , [/COLOR]
(the // is just a wild shot. What should I use that so the comment doesn't affect the code?)
Thanks
15 Feb 2013, 16:41
Reply
Reply with Quote
Like (0)
#2
Join Date:
Jun 2005
Posts:
10,324
Plugin Contributions:
0
Re: Add a personal note in a php file
Yes... this COMMENTS OUT php code - but be aware that in many files, the php is interspersed with html markup.
You can use the // comment tags, when the strings you are working with are enclosed in:
<?php
code here...
?>
When it breaks to HTML, you use <!-- html here... -->
15 Feb 2013, 17:01
Reply
Reply with Quote
Like (0)
#3
Join Date:
Jan 2007
Posts:
417
Plugin Contributions:
0
Re: Add a personal note in a php file
Ah perfect. That's why it hadn't worked for me a while back.
Thanks for explaining.
16 Feb 2013, 15:30
Reply
Reply with Quote
Like (0)
#4
Join Date:
Feb 2006
Posts:
10,620
Plugin Contributions:
212
Re: Add a personal note in a php file
Also note that // is a single line comment. If you want multiline comments, you can enclose them in /* and */
/*
This is a
multiline
comment
*/
is the same as
// This is a
// multiline
// comment