Files
php-question/Question08-Function/Ex04.php
2026-10-13 13:06:15 +09:00

22 lines
512 B
PHP
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/* TODO:
* 以下の仕様で関数を作成してください
*
* 関数名 :convertMessage
* 引数 :str
*
* 引数で渡された値の前後に 「 」 を付与して出力する関数("「"と引数と"」"の連結)
*/
function convertMessage($str)
{
$result = "「". $str. "」" ;
return $result;
}
$message = 'Hello, world!';
// TODO: 関数convertMessageを(変数messageを引数に)で呼び出してください
$result = convertMessage ($message);
echo $result ;