私はXMLに取り組んでおり、simplexmlを使用しました。
$xml = simplexml_load_file(a xml file); //this website is just chosen randomly
if(!in_array($iindex,$category_type)){
$category_type[] = $iindex;
$category_type[$iindex] = 1;
} else {
$category_type[$iindex] = $category_type[$iindex] + 1;
}
}
foreach($category_type as $key=> $value){
echo " number of $key is ". $value;
}
私が現在得た結果は
number of 0 is Really Funny Jokes
number of Really Funny Jokes is 13
number of 1 is Clean jokes
私が期待している結果は
number of Really Funny Jokes is 13
number of Clean jokes is 6
number of Good jokes is 2
誰かが私のコードを手伝ってくれませんか?