<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>hnw</author_name>
  <author_url>https://blog.hatena.ne.jp/hnw/</author_url>
  <blog_title>hnwの日記</blog_title>
  <blog_url>https://hnw.hatenablog.com/</blog_url>
  <categories>
    <anon>PHP</anon>
  </categories>
  <description>プログラムを書いていると、入力値が辞書に含まれているかを調べたいようなことがあります。たとえば、ユーザーに都道府県名を入力させて、それが正しい都道府県名であるかどうかを調べたい、というようなことがあるかもしれません。このような内容をPHPで書く際、キーに都道府県名を持つような連想配列を作る習慣がある人は多いはずです。これは典型的な連想配列の使い方といえるでしょう。 &lt;?php $prefs = array( &quot;北海道&quot; =&gt; true, &quot;青森&quot; =&gt; true, // ... &quot;沖縄&quot; =&gt; true, ); if (isset($prefs[$input])) { // 都道府県名が正しい…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fhnw.hatenablog.com%2Fentry%2F20170521&quot; title=&quot;PHPの連想配列は常にin_arrayより速いのか - hnwの日記&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn-ak.f.st-hatena.com/images/fotolife/h/hnw/20170521/20170521203150.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2017-05-21 00:00:00</published>
  <title>PHPの連想配列は常にin_arrayより速いのか</title>
  <type>rich</type>
  <url>https://hnw.hatenablog.com/entry/20170521</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
