A comment on comments.

Posted by Mikey McCorry | Posted in Uncategorized | Posted on 05-11-2008

Tags: ,

0

In the “you learn something new every day” category, comes this. I just found out that when working with php, you can use block commenting (like /*this*/) in the middle of a line of code. For example, if you have something like this:

$debug = 'really cool ';
echo 'This is my '.$debug.'script!';

… you can remove your debug display by commenting it out mid-line like this:

$debug = 'really cool ';
echo 'This is my './*$debug.*/'script!';

Now, this may already be obvious to everyone else, but I thought this was pretty handy to know.

Write a comment