質問編集履歴

1

2016/04/27 02:23

投稿

442ky119
442ky119

スコア207

test CHANGED
File without changes
test CHANGED
@@ -8,6 +8,10 @@
8
8
 
9
9
  ちなみに作成したphpのコードは下記に記載しています。
10
10
 
11
+ 僕の質問を投げやりだというご指摘がありましたが、何処が投げやりなのですか?
12
+
13
+ 僕の質問はapiのphpファイルをもっと具体的にしたい、ですが色々と調べても明確な答えがない、それが何処が投げやりなのですか?
14
+
11
15
  > 引用テキスト
12
16
 
13
17
  <?php /* Template Name: takeout */ ?> <?php if(have_posts()): while(have_posts()): the_post();?> <h2><?php the_title(); ?></h2> <?php the_content(); ?> <?php endwhile; endif; ?> <!DOCTYPE html> <html lang="ja"> <head> <meta charset="UTF-8"> <title>YOLP</title> <head> <body> <?php $id = '私のid'; $area= 13; $ct ='0114'; $start = '1'; $url = 'http://search.olp.yahooapis.jp/OpenLocalPlatform/V1/localSearch?appid='.$id.'&ac='.$area.'&gc='.$ct.'&results=100&start='.$start.'&detail=full'; $xml = simplexml_load_file( $url ); $total = $xml ->ResultInfo->Total; $loop = (int)($total/100); $i = 0; while($i <= $loop){ $start = 100*$i+1; $url = 'http://search.olp.yahooapis.jp/OpenLocalPlatform/V1/localSearch?appid='.$id.'&ac='.$area.'&gc='.$ct.'&results=200&start='.$start.'&detail=full'; $xml = simplexml_load_file( $url ); foreach($xml->Feature as $item){ echo $item->Name. ',' . $item->Property->Yomi .',' . $item->Property->Tel1 . ',' . $item->Property->Address . ',' . $item->Property->Station->Railway . $item->Property->Station->Name . '駅' .$item->Property->Detail->OfficialPcUrl1; echo '<br />'; } $i++; } ?>> 引用テキスト