{"id":37,"date":"2008-06-20T15:18:40","date_gmt":"2008-06-20T06:18:40","guid":{"rendered":"http:\/\/www.kaz.bz\/wp\/2008-06-20_216\/"},"modified":"2008-06-20T15:18:40","modified_gmt":"2008-06-20T06:18:40","slug":"php%e3%81%ae%e7%bd%ae%e6%8f%9btips%ef%bc%88str_replace-%e3%81%ab%e9%85%8d%e5%88%97%e3%82%92%ef%bc%89%e3%80%82","status":"publish","type":"post","link":"https:\/\/wp.kaz.bz\/tech\/2008\/06\/20\/37.html","title":{"rendered":"PHP\u306e\u7f6e\u63dbTips\uff08str_replace \u306b\u914d\u5217\u3092\uff09\u3002"},"content":{"rendered":"<p>PHP\u306e\u7f6e\u63dbTips\u3002<\/p>\n<p>str_replace [1]\u306e\u5f15\u6570\u306b\u306f\u914d\u5217\u304c\u4f7f\u3048\u308b\u3002<\/p>\n<p>str_replace($a, $b ,$src);<\/p>\n<p>\u3067$a\u3001$b\u304c\u914d\u5217\u306e\u5834\u5408\u3001\u540c\u3058\u8981\u7d20\u540c\u58eb\u3067\u7f6e\u63db\u3055\u308c\u308b\u3002<\/p>\n<p>$a[0]\u3000\u2192 $b[0]<\/p>\n<p>\u3053\u306e\u6642\u306e\u914d\u5217\u3067\u9023\u60f3\u914d\u5217\u3092\u5229\u7528\u3057\u3066\uff08$a['\u7f6e\u63db\u524d\u306e\u6587\u5b57\u5217'] =  '\u7f6e\u63db\u5f8c\u306e\u6587\u5b57\u5217' \uff09\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u308b\u3002<\/p>\n<p>str_replace(array_keys($a), array_values($a) ,$src);<\/p>\n<p>\u7f6e\u63db\u5bfe\u8c61\u304c\u5897\u3048\u3066\u304d\u305f\u5834\u5408\u3001<\/p>\n<p>$a = array(<br \/>\n    \"\u7f6e\u63db\u524d1\" =>  \"\u7f6e\u63db\u5f8c1\"<br \/>\n    , \"\u7f6e\u63db\u524d2\" =>  \"\u7f6e\u63db\u5f8c2\"<br \/>\n    , \"\u7f6e\u63db\u524d3\" =>  \"\u7f6e\u63db\u5f8c3\"<br \/>\n    , \"\u7f6e\u63db\u524d4\" =>  \"\u7f6e\u63db\u5f8c4\"<br \/>\n);<\/p>\n<p>\u3068\u3067\u304d\u308b\u306e\u3067\u53ef\u8aad\u6027\u304c\u9ad8\u304f\u306a\u308b\u3002<\/p>\n<p>[1] http:\/\/php.net\/str_replace<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PHP\u306e\u7f6e\u63dbTips\u3002 str_replace [1]\u306e\u5f15\u6570\u306b\u306f\u914d\u5217\u304c\u4f7f\u3048\u308b\u3002 str_replace($a, $b ,$src); \u3067$a\u3001$b\u304c\u914d\u5217\u306e\u5834\u5408\u3001\u540c\u3058\u8981\u7d20\u540c\u58eb\u3067\u7f6e\u63db\u3055\u308c\u308b\u3002 $a[0]\u3000\u2192 $b[0] \u3053\u306e [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[24],"tags":[],"class_list":["post-37","post","type-post","status-publish","format-standard","hentry","category-php"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":60,"url":"https:\/\/wp.kaz.bz\/tech\/2007\/07\/02\/60.html","url_meta":{"origin":37,"position":0},"title":"vi\u306e\u7f6e\u63dbetc.","author":"kaz. Suenaga","date":"2007\/07\/02","format":false,"excerpt":"\u25a0vi\u306e\u7f6e\u63db \u30fb\u30d5\u30a1\u30a4\u30eb\u5168\u4f53\u306e\u7f6e\u63db :%s\/\u691c\u7d22\u6587\u5b57\u5217\/\u7f6e\u63db\u5f8c\u6587\u5b57\u5217\/g http:\/\/www.at\u2026","rel":"","context":"vi","block_context":{"text":"vi","link":"https:\/\/wp.kaz.bz\/tech\/category\/servers\/vi"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":333,"url":"https:\/\/wp.kaz.bz\/tech\/2010\/10\/14\/333.html","url_meta":{"origin":37,"position":1},"title":"Linux\u306e tr \u30b3\u30de\u30f3\u30c9","author":"kaz. Suenaga","date":"2010\/10\/14","format":false,"excerpt":"\u7f6e\u63db\u30b3\u30de\u30f3\u30c9\u3002 \u7f6e\u63db\uff1a tr \u6587\u5b57\u52171 \u6587\u5b57\u52172 \u524a\u9664\uff1a tr -d \u6587\u5b57\u5217 \u3088\u304f\u4f7f\u3046\u306e\u306f\u6539\u884c\u524a\u9664\u3002\u2026","rel":"","context":"\u30b3\u30de\u30f3\u30c9\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9","block_context":{"text":"\u30b3\u30de\u30f3\u30c9\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9","link":"https:\/\/wp.kaz.bz\/tech\/category\/cmdref"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":26,"url":"https:\/\/wp.kaz.bz\/tech\/2008\/12\/09\/26.html","url_meta":{"origin":37,"position":2},"title":"\u30bd\u30fc\u30b9\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u5834\u5408\u306eapache2\u306e\u8d77\u52d5\u30b9\u30af\u30ea\u30d7\u30c8\u3002","author":"kaz. Suenaga","date":"2008\/12\/09","format":false,"excerpt":"\uff08\u30bd\u30fc\u30b9\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\uff09\/build\/rpm\/httpd.init \u3068\u3057\u3066\u3001RPM\u7248\u306e\u5834\u5408\u306e\u8d77\u52d5\u30b9\u30af\u30ea\u2026","rel":"","context":"Apache","block_context":{"text":"Apache","link":"https:\/\/wp.kaz.bz\/tech\/category\/servers\/apache"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":325,"url":"https:\/\/wp.kaz.bz\/tech\/2010\/10\/14\/325.html","url_meta":{"origin":37,"position":3},"title":"Linux\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3067GET\/POST","author":"kaz. Suenaga","date":"2010\/10\/14","format":false,"excerpt":"HTTP\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30b3\u30de\u30f3\u30c9\u3002 perl\u30d9\u30fc\u30b9\u3089\u3057\u3044\u3002 CentOS\uff15\u7cfb\u3067yum \u306e\u5834\u5408 yum i\u2026","rel":"","context":"\u30b3\u30de\u30f3\u30c9\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9","block_context":{"text":"\u30b3\u30de\u30f3\u30c9\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9","link":"https:\/\/wp.kaz.bz\/tech\/category\/cmdref"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":27,"url":"https:\/\/wp.kaz.bz\/tech\/2008\/12\/09\/27.html","url_meta":{"origin":37,"position":4},"title":"VBA\u3067\u914d\u5217\u306b\u8981\u7d20\u3092\u8ffd\u52a0\u3059\u308b","author":"kaz. Suenaga","date":"2008\/12\/09","format":false,"excerpt":"\u3044\u3061\u3044\u3061Redim\u3059\u308b\u306e\u304c\u9762\u5012\u306a\u306e\u3067Sub\u306b\u307e\u3068\u3081\u308b\u3002 \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u914d\u5217\u5bfe\u5fdc\u306e\u3064\u3082\u308a\uff08\u672a\u691c\u8a3c\uff09\u3002 '\u2026","rel":"","context":"VBA\uff0fASP\u306a\u3069","block_context":{"text":"VBA\uff0fASP\u306a\u3069","link":"https:\/\/wp.kaz.bz\/tech\/category\/langs\/vba_asp_etc"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":50,"url":"https:\/\/wp.kaz.bz\/tech\/2008\/03\/13\/50.html","url_meta":{"origin":37,"position":5},"title":"PostgreSQL\u306eARRAY\u95a2\u6570\u3002","author":"kaz. Suenaga","date":"2008\/03\/13","format":false,"excerpt":"SQL\u5b9f\u884c\u3059\u308b\u969b\u306b\u3001ARRAY()\u95a2\u6570\u3092\u5229\u7528\u3059\u308b\u3068\u914d\u5217\u3067\u7d50\u679c\u30bb\u30c3\u30c8\u304c\u5f97\u3089\u308c\u308b\u3002 \u4f8b\uff09 SELECT \u2026","rel":"","context":"PostgreSQL","block_context":{"text":"PostgreSQL","link":"https:\/\/wp.kaz.bz\/tech\/category\/servers\/db\/postgresql"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/wp.kaz.bz\/tech\/wp-json\/wp\/v2\/posts\/37","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.kaz.bz\/tech\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.kaz.bz\/tech\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.kaz.bz\/tech\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.kaz.bz\/tech\/wp-json\/wp\/v2\/comments?post=37"}],"version-history":[{"count":0,"href":"https:\/\/wp.kaz.bz\/tech\/wp-json\/wp\/v2\/posts\/37\/revisions"}],"wp:attachment":[{"href":"https:\/\/wp.kaz.bz\/tech\/wp-json\/wp\/v2\/media?parent=37"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.kaz.bz\/tech\/wp-json\/wp\/v2\/categories?post=37"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.kaz.bz\/tech\/wp-json\/wp\/v2\/tags?post=37"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}