PHP 関数
WindowsAPI コマンドライン引数
#include
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR pCmdLine, int nCmdShow) {
MessageBox(NULL, GetCommandLine(),
TEXT(“勇者の攻撃!”), MB_ICONINFORMATION);
return 0;
}
PHP sprintf
WindowsAPI メッセージボックス
#include
int WINAPI WinMain(
HINSTANCE hInstance ,
HINSTANCE hPrevInstance ,
PSTR lpCmdLine ,
int nCmdShow ) {
MessageBox(NULL , TEXT(“Kitty on your lap”) ,
TEXT(“メッセージボックス”) , MB_OK);
return 0;
}
http://wisdom.sakura.ne.jp/system/winapi/win32/win5.html
PHP 変数の返り値
PHP 可変長引数
PHP 配列
<?php
$moreScores = [
55,
72,
‘perfect’,
[90, 42, 88],
];
$scores = [
90,
40,
…$moreScores,
100,
];
// print_r($scores);
echo $scores[5][2] . PHP_EOL;
PHP foreach
<?php
$scores = [
‘first’ => 90,
‘second’ => 40,
‘third’ => 100,
];
// foreach ($scores as $value) {
// foreach ($scores as $score) {
// echo $score . PHP_EOL;
// }
foreach ($scores as $key => $score) {
echo $key . ‘ – ‘ . $score . PHP_EOL;
}
PHP 配列
<?php
$scores = [
‘first’ => 90,
‘second’ => 40,
‘third’ => 100,
];
// var_dump($scores);
// print_r($scores);
echo $scores[‘third’] . PHP_EOL;