データに該当した場合、カテゴリーが出るようにPHPを組んでいます。
※該当ない場合は該当なしと出てくるようにしています。
カテゴリーの上に以下のジャンルから選んでくださいとタイトルをつけたいのですが、
PHP初心者のため、どのように差し込めばいいかわかりません。
できたら該当なしと同じような文字サイズで出現させたいので<P>タグを使うのが
理想です。
ちなみにトライしましたが、うまく表示できませんでした。
html
1<?php for($s=1; $s<=6; $s++){ //s-1?> 2 3 <div class="sportsMenuSection sportsMenu_area2state<?php echo $s+1;?>" style="display: none;"> 4 <?php if(!empty($pageData->thing_info_list[$s]->thing_business)) { ?> 5 <?php 6 $arr_count = count($pageData->thing_info_list[$s]->thing_business->thing_business_code); 7 for($t=0; $t<$arr_count; $t++){ 8 ?> 9 <a href="/thing/index.php?state=<?php echo $s+1;?>&business=<?php echo $pageData->thing_info_list[$s]->thing_business->thing_business_code[$t];?>"><?php echo $pageData->thing_info_list[$s]->thing_business->thing_business_name[$t];?></a> 10 <?php 11 } 12 ?> 13 <?php } else {?> 14 <p>該当なし</p> 15 <?php }?> 16 </div> 17<?php } ?>
ご教授お願いします。
よろしくお願いいたします。
回答2件
あなたの回答
tips
プレビュー