このコードは機能し、それを達成するためのより良い方法があるかもしれませんが、私の質問は、
このように通過するための特定の用語はありますか?(無名関数と同様に)、
これは許容できる方法ですか?、
それは基準に反していますか?
<?php
// suppose the only way i can retrieve the content is by using this function
//like wordpress equivalent of the_content()
function mycontent()
{
$Original_content="oldcontent";
return $Original_content;
}
//instead of ---> echo $Original_content."facebook,twitter code";
//if i define a new function
function social_share($content)
{
$added_social=$content;
$added_social.=" + facebook,twitter code...";
echo $added_social;
}
//function call
social_share(mycontent());
?>
前もって感謝します :)