- リスト 1
- リスト 2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $compile = ""; | |
| $compile .= file_get_contents("index.php"); | |
| if(preg_match("/include/", $compile)){ | |
| $compile = preg_replace_callback("/include.*\"(.*\.php)\"/", | |
| function($matches){ | |
| return preg_replace("/^<\?php/", "", file_get_contents($matches[1])); | |
| }, $compile); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| aaaa |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| if($_GET['status']=='create'){?> | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>作成ページです</title> | |
| </head> | |
| <body> | |
| <p>りんご</p> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // 下記を関数にする | |
| // $result = 0; | |
| // for($i = 1; $i <= 5; $i++ ){ | |
| // $result += $i; | |
| // } | |
| // print $result.PHP_EOL; | |
| // $result = 0; | |
| // for($i = 1; $i <= 6; $i++ ){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Your code here! | |
| $dinner = "hamburg"; | |
| // 何か | |
| if ($dinner == 'hamburg') { | |
| echo 'おいしそう!お肉は大好きです'; | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Your code here! | |
| // 1.引数に数値を指定して実行すると、数値を2倍にして返す関数を作成してください | |
| function times2($num){ | |
| return $num * 2; | |
| } | |
| // echo times2(5).PHP_EOL; | |
| // $a と $b を仮引数に持ち、 $a と $b を足した結果を返す関数を作成してください。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // $name にあなたの名前を代入し、 if文で $name があなたの名前だったら 「私は あなたの名前 です」、 | |
| // もし違ったら「あなたの名前ではありません」と表示するように実装してください。 | |
| $name = "Tomoya"; | |
| if($name == "Tomoya"){ | |
| echo "私は ".$name."です".PHP_EOL; | |
| }else{ | |
| echo $name."ではありません".PHP_EOL; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //https://tech-boost.jp/common/books/125 | |
| // $a という変数に3を、$b という変数に7を代入して、echoを使って$a+$bの結果を表示してみましょう。 | |
| $a = 3; | |
| $b = 7; | |
| $result = $a + $b; | |
| echo $result.PHP_EOL; | |
| // $array_month という配列に1月〜12月の文字列を代入し、echoで8月を表示してみましょう。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # coding: utf-8 | |
| # Your code here! | |
| import math | |
| n = int(input()) | |
| xs = list(map(int,input().split())) | |
| ys = list(map(int,input().split())) | |
| ds = [abs(x-y) for(x,y) in zip(xs,ys)] |
NewerOlder