php
<html>
<body>
<form action='test.php' method='get'>
<input type='text' name='txt1'>
<?php
if (isset($_GET['txt1'])) {
echo $_GET['txt1'];
}
?>
<br/>
<input type='text' name='txt2'>
<?php
if (isset($_GET['txt2'])) {
echo $_GET['txt2'];
}
?>
<br/>
<input type='submit'>
</form>
<hr/>
<form action='test.php' method='post'>
<input type='text' name='txt3'>
<?php
if (isset($_POST['txt3'])) {
echo $_POST['txt3'];
}
?>
<br/>
<input type='submit'>
</form>
<?php
$items = [['name' => '吉田', 'age' => 20, 'genderId' => 0], ['name' => '田中', 'age' => 30, 'genderId' => 1]];
$gender = [0 => '男', 1 => '女'];
$tbl = '<table border=1>';
foreach ($items as $i => $val) {
$tbl .= '<tr><td>' . $val['name'] . '</td><td>' . $val['age'] . '</td><td>' . $gender[$val['genderId']] . '</td></tr>';
}
$tbl .= '</table>';
echo $tbl;
// $html = file_get_contents('https://stocks.finance.yahoo.co.jp/stocks/history/?code=USDJPY=X');
// echo $html;
// var_dump($items);
?>
</body>
</html>