← 記事に戻る
# var_exportという関数がprint_rよりも使える?

[![](https://zip358.com/wp-content/uploads/2017/06/var_export.jpg)](https://zip358.com/wp-content/uploads/2017/06/var_export.jpg)var\_exportという関数がprint\_rよりも使い物になるかも。 何が良いかは、下記の仕様を読んで下さい。 http://php.net/manual/ja/function.print-r.php http://php.net/manual/ja/function.var-export.php この頃、知ったことと言えばPHPにはarray\_searchとかいう関数と in\_arrayとかいう関数があるのですけど、in\_arrayの方を 使用することが安全だと知りました。 array\_searchは配列の中から同じ変数を見つけてくるのですけど 最初に見つけた配列番号だったかな、それを返却値として 返してくれるのです、なので、そのままif文で判断していると痛い目に 合います。何故って配列番号0番目にあった場合、戻り値が 0番目なので、if文で偽の判断をしてしまうのです。 ここかなり痛い要素です。 if文の中で真偽の判断する場合はfalseで判断してあげると 良いでしょうということです。そういう事があるので in\_arrayの方が良いのかもしれないと思った次第です。 http://php.net/manual/ja/function.array-search.php http://php.net/manual/ja/function.in-array.php [](https://zip358.com/wp-content/uploads/2017/06/prt.jpg) [ ![](https://zip358.com/wp-content/uploads/2026/01/image-31.png) サイトを分離した話を黙々と書いていきます.

 ](https://zip358.com/2026/02/04/%e3%82%b5%e3%82%a4%e3%83%88%e3%82%92%e5%88%86%e9%9b%a2%e3%81%97%e3%81%9f%e8%a9%b1%e3%82%92%e9%bb%99%e3%80%85%e3%81%a8%e6%9b%b8%e3%81%84%e3%81%a6%e3%81%84%e3%81%8d%e3%81%be%e3%81%99.html) 

 [ ![](https://zip358.com/wp-content/uploads/2026/01/image-30-300x300.png) 半額セールでアドビ様を延長.

 ](https://zip358.com/2026/02/03/%e5%8d%8a%e9%a1%8d%e3%82%bb%e3%83%bc%e3%83%ab%e3%81%a7%e3%82%a2%e3%83%89%e3%83%93%e6%a7%98%e3%82%92%e5%bb%b6%e9%95%b7.html) 

 [ ![](https://zip358.com/wp-content/uploads/2026/01/image-29.png) 何の前触れもなく変えたのは初めてかも.

 ](https://zip358.com/2026/02/02/%e4%bd%95%e3%81%ae%e5%89%8d%e8%a7%a6%e3%82%8c%e3%82%82%e3%81%aa%e3%81%8f%e5%a4%89%e3%81%88%e3%81%9f%e3%81%ae%e3%81%af%e5%88%9d%e3%82%81%e3%81%a6%e3%81%8b%e3%82%82.html) 

 [ ![](https://zip358.com/wp-content/uploads/2023/01/you-300x300.png) 跳ねたいサイトで跳ねたい

 ](https://zip358.com/2026/02/01/%e8%b7%b3%e3%81%ad%e3%81%9f%e3%81%84%e3%82%b5%e3%82%a4%e3%83%88%e3%81%a7%e8%b7%b3%e3%81%ad%e3%81%9f%e3%81%84.html) 

 [ ![](https://zip358.com/wp-content/uploads/2026/01/image-36.png) 映画、機動戦士ガンダム 閃光のハサウェイ キルケーの魔女

 ](https://zip358.com/2026/01/31/%e6%98%a0%e7%94%bb%e3%80%81%e6%a9%9f%e5%8b%95%e6%88%a6%e5%a3%ab%e3%82%ac%e3%83%b3%e3%83%80%e3%83%a0-%e9%96%83%e5%85%89%e3%81%ae%e3%83%8f%e3%82%b5%e3%82%a6%e3%82%a7%e3%82%a4-%e3%82%ad%e3%83%ab%e3%82%b1.html)