質問編集履歴

1

中略致しました・・・

2021/07/07 16:39

投稿

ques346
ques346

スコア47

test CHANGED
File without changes
test CHANGED
@@ -12,57 +12,15 @@
12
12
 
13
13
 
14
14
 
15
- a,1,2,2
15
+ 中略
16
-
17
- b,1,2,2
18
-
19
- c,1,2,2
20
-
21
-
22
16
 
23
17
  ```php
24
18
 
25
- $file_name = "score.txt"; /*読込ファイルの指定*/
19
+ $file_name
26
20
 
27
- $score2 = file( $file_name ); /*ファイルを全て配列に入れる*/
21
+ 中略
28
22
 
29
- $log6 = array();
30
-
31
-
32
-
33
- for($i = 0 ; $i < count($score2); $i++){
34
-
35
- $score3[$i] = explode(",",$score2[$i]);
36
-
37
- }
38
-
39
-
40
-
41
- $sameno = array_search( $name, array_column( $score3, 0));
42
-
43
-
44
-
45
- if ($sameno != false){
46
-
47
- unset($score3[$sameno]);
23
+ n.PHP_EOL,FILE_APPEND);
48
-
49
- file_put_contents("score.txt", $score3);
50
-
51
- }
52
-
53
-
54
-
55
- var_dump($name);
56
-
57
- var_dump($score2);
58
-
59
- var_dump($score3);
60
-
61
- var_dump($sameno);
62
-
63
-
64
-
65
- file_put_contents("score.txt",$name.",".$time.",".$score.",".$souten.PHP_EOL,FILE_APPEND);
66
24
 
67
25
  ```
68
26
 
@@ -80,7 +38,7 @@
80
38
 
81
39
 
82
40
 
83
- string(1) "b" array(3) { [0]=> string(8) "a,1,2,2 " [1]=> string(8) "b,1,2,2 " [2]=> string(8) "c,1,2,2 " } array(2) { [0]=> array(4) { [0]=> string(1) "a" [1]=> string(1) "1" [2]=> string(1) "2" [3]=> string(2) "2 " } [2]=> array(4) { [0]=> string(1) "c" [1]=> string(1) "1" [2]=> string(1) "2" [3]=> string(2) "2 " } } int(1)
41
+ string(1) 中略 int(1)
84
42
 
85
43
 
86
44