PHP関数コードについては、どのようにコードをコメントアウトしますか?これは正しいのですか、それとも最善の方法ですか?どのようにPHP関数内のコードをコメントアウトしますか?
function menu_element_builder($values) {
//$links = '';
}
PHP関数コードについては、どのようにコードをコメントアウトしますか?これは正しいのですか、それとも最善の方法ですか?どのようにPHP関数内のコードをコメントアウトしますか?
function menu_element_builder($values) {
//$links = '';
}
あなた次第、//
または#
と行をコメントアウトします。
コメント行の一部またはコードブロック全体が/* [commented code] */
です。
function menu_element_builder($values/*, $optional_value*/) {
#Commented out line
echo "Not commented out";
//Commented out line
echo "Not commented out";
/* Commented out code block
echo "Commented out"; */
echo "Not commented out"; //but this is ." and so's this";
echo "Not commented out" /* but this is */ ." and this isn't";
/* This is commented out */ echo "But this isn't";
}
<?php
// This is a single-line comment
# This is also a single-line comment
/*
This is a multiple-lines comment block
that spans over multiple
lines
*/
// Aswell you can use comments to hide part of your code from execution
$x = 5 /* + 15 */ + 5;
echo $x;
?>
//と/ * */..私は、コードをコメントで最善の方法があれば知らない:あなたは、あなたがそれを必要とする理由を自問しなければならないコードをコメントアウトする必要がある場合はまあD – user489872
?そして、もしあなたがそれを単に削除することはできません。 – Rizier123
構文が関数内で同じ働きをするかどうかは分かりませんでした。今私は知っている! – DDJ