ものすごい数のエラーが出てしまいます。
どこを直せば良いのでしょうか?
PHP
1<?php 2 3$data=file_get_contents("plan.csv");//指定したファイルを読み込む 4 5$data=explode("\r",$data);//改行は\r 6 7echo("<pre>"); 8var_dump($data); 9echo("</pre>"); 10 11foreach($data as $key =>$value){ 12 $line_array=explode(",",$value);//カンマで分割して配列化 13 if($key==0){ 14 //コンバイン用配列を作成 15 $data_key=$line_array; 16 }elseif(!empty($value)){ 17 //空じゃなかったら配列に入れる 18 //$plan[]=$line_array; 19 $plan[]=array_combine($data_key,$line_array);//連想配列にして代入 20 } 21} 22echo("<pre>"); 23var_dump($plan); 24echo("</pre>"); 25 26//file_put_contents('plan.csv',mb_convert_encoding($output_str,'sjis-win','UTF-8')); 27 28//$test="変数test(中身)"; 29//file_put_contents('test2A.txt',"これはテストです \r $test"); 30//file_put_contents('test2B.txt',"これはテストです \r 31 //$test"); 32//ファイル名と内容を引数 33 34?><!DOCTYPE html> 35<html lang="ja"> 36<head> 37<title>サーバサイドWebプログラミング</title> 38<meta charset="UTF-8"> 39</head> 40<body bgcolor="e6e6fa"> 41 42<h1>多次元配列</h1> 43 44<table border='1'> 45<tr> 46<td>id</td> 47<td>year</td> 48<td>month</td> 49<td>day</td> 50<td>content</td> 51<td>過去、本日、未来、一週間</td> 52</tr> 53 54<?php 55foreach($plan as $key => $value){ 56 // $plansの中身の数だけ繰り返す 57 // $keyにキーが格納され、$valueに値が格納される 58 $array_year[]=$value['year'] ; 59 $array_month[]=$value['month'] ; 60 $array_day[]=$value['day'] ;} 61 62 //削除機能 63 foreach($plan as $key =>$value){ 64 if(!empty($_GET['action'])== 'delete' AND $_GET['id'] == $plan[$key]['id']) { 65 unset($plan[$key]); 66 } 67 } 68 69 //ソート用の配列 70 array_multisort($array_year,SORT_ASC, 71 $array_month,SORT_ASC, 72 $array_day,SORT_ASC, 73 74 $plan); 75 76 $output_str="id,year,month,day,content \r"; 77 78 //各行に対して処理するためのループ 79 foreach($plan as $key => $line){ 80 // echo('<pre>'); 81 //var_dump($line); 82 //echo('</pre>'); 83 84 foreach($plan as $key_line => $value_line){ 85 //echo('<pre>'); 86 //var_dump($value_line); 87 //echo('</pre>'); 88 $output_str=$output_str.$value_line.","; 89 } 90 //最後のカンマを削除 91 $length = mb_strlen($output_str);// 92 $output_str = mb_substr($output_str, 0, -1);//元に文字列の最初(0)から、元の文字列の長さ−1を取り出す 93 94 $output_str=$output_str."\r"; 95 96 97 echo('<pre>'); 98 var_dump($output_str); 99 echo('</pre>'); 100 101 ?> 102 103<tr> 104<td><?php echo $plan[$key]['id']?></td> 105<td><?php echo $plan[$key]['year']?></td> 106<td><?php echo $plan[$key]['month']?></td> 107<td><?php echo $plan[$key]['day']?></td> 108<td><?php echo $plan[$key]['content']?></td> 109<td><?php 110 111//if(予定のタイム < 今日のタイム) 112if(mktime(0,0,0,$value["month"],$value["day"],$value["year"])<strtotime("today")){ 113 echo "過去"; 114} elseif (mktime(0,0,0,$value["month"],$value["day"],$value["year"])==strtotime("today")){echo "本日"; 115} elseif(mktime(0,0,0,$value["month"],$value["day"],$value["year"])<=strtotime("+7 day")){echo "一週間以内";} 116 117else { 118 echo "未来"; 119} 120?> 121 122</td> 123</tr> 124 125<?php } ?> 126 127</table>
Notice: Array to string conversion in /Applications/XAMPP/xamppfiles/htdocs/PHP/PHP/ss9-2.php on line 90 Notice: Array to string conversion in /Applications/XAMPP/xamppfiles/htdocs/PHP/PHP/ss9-2.php on line 90 Notice: Array to string conversion in /Applications/XAMPP/xamppfiles/htdocs/PHP/PHP/ss9-2.php on line 90 Notice: Array to string conversion in /Applications/XAMPP/xamppfiles/htdocs/PHP/PHP/ss9-2.php on line 90 Notice: Array to string conversion in /Applications/XAMPP/xamppfiles/htdocs/PHP/PHP/ss9-2.php on line 90 string(59) "id,year,month,day,content Array,Array,Array,Array,Array " Notice: Array to string conversion in /Applications/XAMPP/xamppfiles/htdocs/PHP/PHP/ss9-2.php on line 90 Notice: Array to string conversion in /Applications/XAMPP/xamppfiles/htdocs/PHP/PHP/ss9-2.php on line 90 Notice: Array to string conversion in /Applications/XAMPP/xamppfiles/htdocs/PHP/PHP/ss9-2.php on line 90 Notice: Array to string conversion in /Applications/XAMPP/xamppfiles/htdocs/PHP/PHP/ss9-2.php on line 90 Notice: Array to string conversion in /Applications/XAMPP/xamppfiles/htdocs/PHP/PHP/ss9-2.php on line 90 string(89) "id,year,month,day,content Array,Array,Array,Array,Array Array,Array,Array,Array,Array " Notice: Array to string conversion in /Applications/XAMPP/xamppfiles/htdocs/PHP/PHP/ss9-2.php on line 90 Notice: Array to string conversion in /Applications/XAMPP/xamppfiles/htdocs/PHP/PHP/ss9-2.php on line 90 Notice: Array to string conversion in /Applications/XAMPP/xamppfiles/htdocs/PHP/PHP/ss9-2.php on line 90 Notice: Array to string conversion in /Applications/XAMPP/xamppfiles/htdocs/PHP/PHP/ss9-2.php on line 90 Notice: Array to string conversion in /Applications/XAMPP/xamppfiles/htdocs/PHP/PHP/ss9-2.php on line 90 string(119) "id,year,month,day,content Array,Array,Array,Array,Array Array,Array,Array,Array,Array Array,Array,Array,Array,Array " Notice: Array to string conversion in /Applications/XAMPP/xamppfiles/htdocs/PHP/PHP/ss9-2.php on line 90 Notice: Array to string conversion in /Applications/XAMPP/xamppfiles/htdocs/PHP/PHP/ss9-2.php on line 90 Notice: Array to string conversion in /Applications/XAMPP/xamppfiles/htdocs/PHP/PHP/ss9-2.php on line 90 Notice: Array to string conversion in /Applications/XAMPP/xamppfiles/htdocs/PHP/PHP/ss9-2.php on line 90 Notice: Array to string conversion in /Applications/XAMPP/xamppfiles/htdocs/PHP/PHP/ss9-2.php on line 90 string(149) "id,year,month,day,content Array,Array,Array,Array,Array Array,Array,Array,Array,Array Array,Array,Array,Array,Array Array,Array,Array,Array,Array " Notice: Array to string conversion in /Applications/XAMPP/xamppfiles/htdocs/PHP/PHP/ss9-2.php on line 90 Notice: Array to string conversion in /Applications/XAMPP/xamppfiles/htdocs/PHP/PHP/ss9-2.php on line 90 Notice: Array to string conversion in /Applications/XAMPP/xamppfiles/htdocs/PHP/PHP/ss9-2.php on line 90 Notice: Array to string conversion in /Applications/XAMPP/xamppfiles/htdocs/PHP/PHP/ss9-2.php on line 90 Notice: Array to string conversion in /Applications/XAMPP/xamppfiles/htdocs/PHP/PHP/ss9-2.php on line 90 string(179) "id,year,month,day,content Array,Array,Array,Array,Array Array,Array,Array,Array,Array Array,Array,Array,Array,Array Array,Array,Array,Array,Array Array,Array,Array,Array,Array "