Upgrade to Pro — share decks privately, control downloads, hide ads and more …

WooCommerceなしでも導入できる!Stripe+WordPressで手軽に決済機能を導...

crebow
October 26, 2018

 WooCommerceなしでも導入できる!Stripe+WordPressで手軽に決済機能を導入する方法

「JP_Stripes (Stripe ユーザーグループ)in 広島 Vol.3 」にて発表したスライドです。
1.決済機能を実装する場合の選択肢とプラグイン
2.StripeCheckoutの実装について
3.Crebow Stripe JP Paymentプラグインを利用したチケット販売サイトの作成例の紹介と解説

crebow

October 26, 2018
Tweet

More Decks by crebow

Other Decks in Programming

Transcript

  1. & ࠃ಺ ࢿۚҠಈۀऀؔ౦ࡒ຿ہ௕ୈ߸ 1BZNFOU1SPDFTTPS 1BZNFOU1SPDFTTPS 1BZNFOUHBUFXBZ 1BZNFOU1SPDFTTPSɿখചళ΍ফඅऀ͔Β௚઀ࢧ෷͍৘ ใΛड͚औΓۜߦ΍ΫϨδοτΧʔυձࣾͷγεςϜʹ௚ ઀ΞΫηεͯ͠ॲཧΛߦ͏͜ͱ͕Ͱ͖Δ ࣄۀܗଶ

    ܾࡁख਺ྉ ສԁҎԼ ສԁ௒ສԁҎԼ ສԁ௒ ສԁҎԼ  ສԁ௒  ԁ݅  ԁ݅  ԁ݅  ԁ݅ ܾࡁ੒ཱ͝ͱ  ➤ ॳظඅ༻͸ແྉɺֹ݄අ·ͨ͸ӅΕͨख਺ྉ͸ Ұ੾ͳ͠ ➤ ࢖ͬͨ෼͚ͩͷख਺ྉ ➤ ϦΞϧλΠϜͷख਺ྉϨϙʔτ ͱ ͷൺֱ ➤ ւ֎͸ख਺ྉ͕มΘΓ·͢ɻ গֹܾࡁ ➤ ݄ؒച্͕ສԁΛ௒͑Δͱ͓τΫʹͳΔϚʔ νϟϯτϨʔτͷద༻ʹ͸ਃ੥͕ඞཁͰ͢ɻ ➤ ւ֎͸ख਺ྉ͕มΘΓ·͢ɻ ➤ গֹܾࡁΛ͝ར༻͍ͨͩ͘ʹ͸ਃ੥͕ඞཁͰ͢ɻ ճͷऔҾֹ͕ࠃ಺औҾ ԁҎԼ ʴԁ
  2. & ৚݅෇͖ແྉ ۜߦޱ࠲΁ ͷҾ͖ग़͠ ➤ ࢒ߴΛۜߦޱ࠲΁Ҿ͖ग़ֹ͕ۚ͢ສԁະຬͷ ৔߹ԁ݅ͷख਺ྉ͕͔͔Γ·͢ɻ ➤ ۚ༥ػؔʹΑΓผ్ख਺ྉ͕͔͔Δ৔߹͕͋Γɺ ࣗ਎Ͱར༻͢Δۚ༥ػؔʹ͓໰͍߹ΘΔඞཁ͕

    ͋Γ·͢ɺ Ҿ͖ग़͠ʹ ཁ͢Δظؒ ग़ۚਃ੥͔ΒʙӦۀ೔ ➤ ۚ༥ػؔʹΑΓҟͳΓ·͢ ि·ͨ͸݄୯Ґͷબ୒ͷࣗಈৼࠐ ར༻Մೳ Χʔυ 7*4".BTUFS+$#  ".&9%JOFST "MJQBZ8F$IBU1BZ "QQMF1BZ(PPHMF1BZ 7*4".BTUFS+$# ".&9%JOFST࿆ۜ +$#͸ผ్ਃ੥͕ඞཁ 7*4".BTUFS+$# ࢧ෷͍ऀ΋ΞΧ΢ϯτొ࿥͕ඞཁɻϝʔϧͰͷܾࡁ੥ ٻ͸ΞΧ΢ϯτొ࿥ෆཁͰܾࡁՄೳɻ ΞΧ΢ϯτొ࿥ෆཁͰܾࡁՄೳ ֹ݄ར༻ྉ ԁ͕͔͔Γ·͢ ΢ΣϒϖΠϝϯτϓϥεΛར༻ͨ͠৔߹ ແྉ
  3. Λબ୒͠·ͨ͠ & ͔ΜͨΜܾࡁϘλϯ )5.-  8PSE1SFTTϓϥάΠϯ༗Γ 1BZ1BMNFΛ࢖͏ख΋͋Δ ಋೖͷ͠΍͢͞ ʢ"1*ͷ஌ࣝͳ͠ʣ 8PSE1SFTTϓϥάΠϯ༗Γ

    ςΫχΧϧ αϙʔτ ಋೖͷ͠΍͢͞ ʢ"1*ͷ஌ࣝ͋Γʣ υΩϡϝϯτͷ ॆ࣮౓ º ˕ º ˕ ˚ ˕ ࣮૷·Ͱʹ ͔͔Δ৹ࠪ࣌ؒ 1BZ1BM࣍ୈ ଈ೔ ໰୊͕ൃ֮ͨ࣌͠఺Ͱࣄޙௐࠪ͋Γ ࢲͷ৔߹
  4. & 4USJQF1BZNFOUTͷಛ௕ σδλϧ঎඼ʢϑΝΠϧɺԻָɺϏ σΦɺిࢠॻ੶ɺ1%'ͳͲʣΛൢച ͢Δ͜ͱ͕Ͱ͖·͢ɻߪೖ͕׬ྃ͠ ͨΒɺϢʔβʔ͸ࣗಈతʹσδλϧ ϑΝΠϧΛμ΢ϯϩʔυͰ͖·͢ɻ ΧʔτϓϥάΠϯ΍γϣοϐϯάܥ ͷϓϥάΠϯΛೖΕͳͯ͘΋ࢧ෷͍ ػೳ͕ಋೖɻ


    ੥ٻઌॅॴͷऩूΛ༗ޮʹ͢ΔΦϓ γϣϯ͕͋Γ·͢ɻ د෇ϘλϯΛ࡞੒͢Δ͜ͱ͕Ͱ͖· ͢ɻΧελϜՁ֨ΛೖྗͰ͖ΔΑ͏ ʹ͢ΔΦϓγϣϯ͕͋Γ·͢ɻ σδλϧϝσΟΞͷൢച ෺ൢʹ΋ར༻Մ د෇ػೳʢ౤͛મػೳʣ ͢΂ͯͷτϥϯβΫγϣϯ͸ɺϓϥ άΠϯͷ஫จϝχϡʔʹอଘ͞Ε· ͢ɻ8PSE1SFTT؅ཧμογϡϘʔυ Ͱߪೖ಺༰ΛݟΔ͜ͱ͕Ͱ͖·͢ɻ ड஫؅ཧ ސ٬ऩू ੡඼͝ͱʹαϯΩϡʔϖʔδ ྖऩॻΛૹΔ ϘλϯςΩετͷΧελϚΠζ 4USJQF͔Βސ٬ʹྖऩॻΛࣗಈతʹૹ৴͢ΔΦϓγϣϯ ߪೖϘλϯͷςΩετมߋ ੡඼͝ͱʹ࡞੒Մೳ νΣοΫΞ΢τϑΥʔϜʹͯऩू
  5. & ఆظߪಡͱఆظࢧ෷͍Λઃఆͯ͠ ސ٬ʹൢച͢Δ͜ͱ͕Ͱ͖·͢ɻ 4VCTDSJQUJPO1BZNFOUT  "QQMFͱ(PPHMF1BZΛ࢖༻ͯ͠ ސ٬͔Βͷࢧ෷͍Λड͚ೖΕΔ͜ ͱ͕Ͱ͖·͢ɻ "QQMFBOE(PPHMF1BZ 

    ΢ΣϒαΠτ্ͷ"MJQBZܦ༝Ͱࢧ ෷͍Λड͚ೖΕΔ͜ͱ͕Ͱ͖·͢ɻ "MJQBZ"EEPO GSFF ෳ਺௨՟ͷΞυΦϯʹΑΓɺސ٬ ͸௨՟Λબ୒͠ɺͦͷ௨՟Ͱ঎඼ Λࢧ෷͏͜ͱ͕Ͱ͖·͢ɻ .VMUJ$VSSFODZ"EEPO  ސ٬ʹൢച͞Εͨσδλϧ੡඼͸ɺ ࣗಈతʹظݶ੾ΕʹͳΔ҉߸Խ͞ Εͨμ΢ϯϩʔυϦϯΫʹΑͬͯ อޢ͞Ε·͢ɻ 4FDVSF%PXOMPBET  4USJQF1BZNFOUT1MVHJOʹΑͬ ͯදࣔ͞ΕΔଟ͘ͷڞ௨ϝοηʔ δΛΧελϚΠζͰ͖·͢ɻ $VTUPN.FTTBHFT"EEPO  ΞϑΟϦΤΠτϓϥάΠϯ͸ɺΞ ΠςϜΛߪೖ͢Δސ٬Λ௥੻͠঺ հऀʹద੾ͳख਺ྉΛत༩͠·͢ɻ 81"GGJMJBUF*OUFHSBUJPO GSFF ސ٬͕ετϥΠϓࢧ෷͍ϘλϯΛ ΫϦοΫ͢ΔͱSF$"15$)"ϙο ϓΞοϓ͕දࣔ͞Ε·͢ɻ SF$"15$)""EEPO GSFF 4USJQF1BZNFOUTͷಛ௕ʲ"EEPOTʳ
  6. & $SFCPX4USJQF+11BZNFOUͷಛ௕ ঎༻ɾඇ঎༻໰Θͣࣗ༝ʹ͝ར༻͍ ͚ͨͩΔ͚ͩͰͳ͘ɺίʔυͷվม ͯ͠࠶ར༻͢Δ͜ͱ͕Ͱ͖·͢ɻ ঎༻ɾඇ঎༻໰Θͣࣗ༝ʹ͝ར༻͍ ͚ͨͩΔ͚ͩͰͳ͘ɺίʔυͷվม ͯ͠࠶ར༻͢Δ͜ͱ͕Ͱ͖·͢ɻ ΧʔτϓϥάΠϯ΍γϣοϐϯάܥ ͷϓϥάΠϯΛೖΕͳͯ͘΋ࢧ෷͍

    ػೳ͕ಋೖ ແྉͰར༻Մೳ ೔ຊਓ޲͚ʹղઆ ෺ൢʹ΋ར༻Մ هࣄʢΞΠςϜʣ͝ͱʹӾཡ੍ݶ͕ Ͱ͖ΔͨΊɺձһ੍αΠτͳͲʹ׆ ༻Ͱ͖·͢ɻ ༗ྉίϯςϯπ഑৴ ঎༻ɾඇ঎༻໰Θͣࣗ༝ʹ͝ར༻͍ ͚ͨͩΔ͚ͩͰͳ͘ɺίʔυͷվม ͯ͠࠶ར༻͢Δ͜ͱ͕Ͱ͖·͢ɻ ࡏݿ؅ཧ ঎༻ɾඇ঎༻໰Θͣࣗ༝ʹ͝ར༻͍ ͚ͨͩΔ͚ͩͰͳ͘ɺίʔυͷվม ͯ͠࠶ར༻͢Δ͜ͱ͕Ͱ͖·͢ɻ ߪೖऀ؅ཧ ઃஔ΍ΧελϚΠζ͕೉͍͠ํʹ͸ νϟοτπʔϧʮTMBDLʯΛར༻͠ ͯಋೖαϙʔτʢ༗ঈʣΛߦ͍·͢ɻ ·݄ͨʑͷӡ༻αϙʔτʢ༗ঈʣ΋ ʹͯରԠ͍ͨ͠·͢ɻ ಋೖαϙʔτ ϓϥάΠϯΛར༻ͨ͠αΠτߏஙͷ ͓ख఻͍΋͍͖ͤͯͨͩ͞·͢ʂ ϑϧΧελϚΠζ (1-ϥΠ ηϯε 8FCIPPL 8FCIPPL 8FCIPPL /&8 /&8
  7. & σδλϧϝσΟΞ ͷൢച ˓ ˓ γεςϜ 4USJQF$IFDLPVU 4USJQF$IFDLPVU ຒΊࠐΈํ๏ γϣʔτίʔυ

    γϣʔτίʔυ ෺ൢར༻ ˓ ˓ ΧελϜֹۚ ˓ ೔ຊޠରԠ - - ೔ຊޠӳޠ ௨՟ ೔ຊԁͷΈ ଞ௨՟ରԠ ϘλϯςΩετ ΧελϜՄ ΧελϜՄ ෳ਺ߪೖ ˓ ˓ ݸผʹରԠʢ༗ྉʣ μ΢ϯϩʔυ 8PSEQSFTTެࣜ (JU)VC 8PSE1SFTTެࣜ΁͸ਃ੥༧ఆ ސ٬؅ཧ ࡏݿ؅ཧ 4USJQF͔Βސ٬ʹ ྖऩॻΛૹΔ 4USJQFʹ Χʔυ৘ใΛอଘ data-allow-remember-me #*--*/(ͷར༻ ʢαϒεΫϦϓγϣϯʣ "QQMF1BZ (PPHMF1BZ ௨஌ϝʔϧ "EEPO<༗ྉ> "EEPO<༗ྉ> "EEPO<༗ྉ> "EEPO<ແྉ> ։ൃத ະఆ ະఆ ະఆ ରԠ༧ఆͳ͠ ݸผରԠʢ༗ྉʣ ˓ ˓ ˓ ˓ ˓ ˓ ˓ ˓ Λൺֱͯ͠Έͨ ͱ
  8. & 4USJQF1)1CJOEJOHTΛར༻͢Δ <?php require_once( dirname(__FILE__).'/stripe-php-6.16.0/init.php'); \Stripe\Stripe::setApiKey('secretkeyxxxxxxxxxxxxxxxxxxxxxxxx'); $token = $_POST[ 'stripeToken'

    ]; $email = $_POST[ 'stripeEmail' ]; $amount = $_POST[ 'amount' ]; $description = $_POST[ 'description' ]; $currency = $_POST[ 'currency' ]; try { $charge = \Stripe\Charge::create(array( 'amount' => $amount, 'currency' => $currency, 'source' => $token, 'description' => $description, 'receipt_email' => $email, )); }ɾɾɾɾɾɾ SFRVJSF@PODFͰJOJUQIQΛಡΈࠐΉ
  9. & DIFDLPVUKTͷهड़ྫ <form action = "xxxxxxxxxxxxxxxxxx" method = “POST"> <script

    src = "https://checkout.stripe.com/checkout.js" class = "stripe-button" data-key = "pk_test_xxxxxxxxxxxxxxxxxxxxx" data-amount = "800" data-name = "ൢചݩ໊" data-description = "঎඼໊" data-image = "https://xxxxxxxxxxx/xxxxxxxxxx.png" data-locale = "auto" data-currency = "jpy" data-zip-code = "false" data-allow-remember-me = "false" data-label = "ࠓ͙͢ߪೖ "> </script> </form>
  10. & طଘͷύϥϝʔλ EBUBLFZ EBUBBNPVOU EBUBOBNF EBUBEFTDSJQUJPO EBUBJNBHF EBUBMPDBMF EBUBDVSSFODZ EBUBBMMPXSFNFNCFSNF

    EBUBMBCFM 1VCMJTIBCMF,FZΛهड़͠·͢ɻඞਢ߲໨Ͱ͢ ܾࡁֹ͍ͤͨۚ͞Λೖྗ͠·͢ɻ γϣοϓ໊΍αΠτ໊Λೖྗ͠·͢ɻ EBUBOBNFͷԼʹදࣔͤ͞Δઆ໌จɻࣈʙࣈఔ౓ ϑΥʔϜͷ্෦ʹදࣔ͞ΕΔΞΠίϯը૾ͷ63-Λೖྗ͢Δ ࢖༻͢Δݴޠ ࢖༻͢Δ௨՟୯Ґͷઃఆ ܾࡁ৘ใͷอଘػೳʢ஫ɿ4USJQFʹอଘ͞Ε·͕͢؅ཧऀ͕؅ཧͰ͖ΔΘ͚Ͱ͸ͳ͍ʣ Ϙλϯͷ໊લ
  11. & ΍Γ͍ͨ͜ͱ ܾࡁ׬ྃ 8FCIPPL 8&# αʔόʔ %# αʔόʔ "KBY ߪೖը໘

    σʔλͷॲཧ ܾࡁޙͷը໘ ಠࣗͷύϥϝʔλΛૹͬͯಈ࡞Λ੍ޚ͍ͨ͠ ঎඼ͷ*%΍঎඼ίʔυϢʔβʔ*%ͳͲಠࣗͷύϥϝʔλ
  12. & ಠࣗύϥϝʔλ͸JOQVUUZQFIJEEFOͰରԠ <input type="hidden" name="amount" value="xxxxx"> <input type="hidden" name="description" value="xxxxx">

    <input type="hidden" name="currency" value="xxxxx"> <input type="hidden" name="userid" value="xxxxx"> <input type="hidden" name="itemname" value="xxxxx"> <input type="hidden" name="daytime" value="xxxxx"> <input type="hidden" name="itemmpostid" value="xxxxx"> <input type="hidden" name="stockuse" value="xxxxx"> <input type="hidden" name="stockcount" value="xxxxx"> <input type="hidden" name="productcode" value=“xxxxx"> </form> ಠࣗύϥϝʔλ͸DIFDLPVUKTͷதʹ͸ؚΊͳ͍
  13. & 4USJQFʹσʔλʹಠࣗύϥϝʔλΛૹΕΔΑ͏ʹ͢Δ $metadata = array( 'userid' => $_POST[ 'userid' ],

    'daytime' => $_POST[ 'daytime' ], 'itemname' => $_POST[ 'itemname' ], 'productcode' => $_POST[ 'productcode' ], 'itemmpostid' => $_POST[ 'itemmpostid' ], 'stockuse' => $_POST[ 'stockuse' ], 'stockcount' => $_POST[ 'stockcount' ], ); ૹΔલʹσʔλΛ഑ྻʹ͢Δ try { $charge = \Stripe\Charge::create(array( 'amount' => $amount, 'currency' => $currency, 'source' => $token, 'description' => $description, 'receipt_email' => $email, 'metadata' => $metadata, )); }ɾɾɾɾɾɾ NFUBEBUBͱͯ͠ૹΔ
  14. & XFCIPPLͰಠࣗύϥϝʔλΛड͚औΕΔΑ͏ʹ͢Δ $webhook_stripeid = $json->data->object->id; $webhook_userid = $json->data->object->metadata->userid; $webhook_itemname =

    $json->data->object->metadata->itemname; $webhook_user = $json->data->object->source->name; $webhook_receipt_email = $json->data->object->receipt_email; $webhook_productcode = $json->data->object->metadata->productcode; $webhook_daytime = $json->data->object->metadata->daytime; $webhook_amount = $json->data->object->amount; $webhook_status = $json->data->object->status; //ࡏݿ؅ཧ $webhook_itemmpostid = $json->data->object->metadata->itemmpostid; $webhook_stockuse = $json->data->object->metadata->stockuse; $webhook_stockcount = $json->data->object->metadata->stockcount; GJMF@HFU@DPOUFOUT QIQJOQVU Ͱ+40/ຊจͷCPEZΛड͚औͬͯ KTPO@EFDPEFؔ਺ͰจࣈྻΛ഑ྻʹมߋ
  15. & ߏஙલʹܾΊ͓ͯ͘͜ͱ ձ৔Ͱͷνέοτ֬ೝͷํ๏ʹ͍ͭͯ ໨ࢹͰ֬ೝ νέοτͷߪೖ੍ݶ ਓຕݶΓ ਓຕͷఆٛ͸ʁਓ͸Ϣʔβʔʁ ؅ཧػೳ͕ඞཁ ߪಡऀొ࿥ͤͯ͞Ϣʔβʔͷ؅ཧ͢Δඞཁ͕͋Δ ౎౓ߪೖ

    طଘͷػೳͰ0, ෳ਺ߪೖ ෳ਺ߪೖͰ͖ΔΑ͏ͳ࢓૊Έ͕ඞཁ ϝʔϧ΍ྖऩॻΛর߹͢Δ࡞ۀ͕ඞཁ 23ͳͲΛൃߦͯ֬͠ೝ ؅ཧػೳ͕ඞཁ $384+1Ͱ͸ߪೖͨ͠Ϣʔβʔ͚ͩʹίϯςϯπΛදࣔͤ͞Δػೳ͋Γ
  16. & " ૉਓ͕ೖྗ͢Δ͜ͱΛ૝ఆ͓ͯ͘͠ ࢓༷͕มΘͬͨࡍɺαΠτ͕දࣔ͞Εͳ͍౳ͷෆ۩߹Λ ճආͰ͖Δઃܭʹ͓ͯ͘͠ αΠτ؅ཧऀ ɾ)5.-ͳͲͷ஌ࣝ͸๡ͯ͘͠΋࢖͑ΔΑ͏ʹ͓ͯ͘͠ ੍࡞ձࣾ ϓϥάΠϯʹ͸खΛೖΕͣ ͦͷ··࢖༻͢Δ

    ΧελϜϑΟʔϧυͳͲϓ ϥάΠϯԽͯ͠࢖༻͢Δ Ξοϓσʔτ͖ΔΑ͏ʹ͓ͯ͘͠ ௥Ճػೳ͸ෆ۩߹͕ग़ͨࡍɺϓϥάΠϯΛఀ ࢭ͢Δ͚ͩͰɺαΠτશମΛࢭΊͳ͍࢓૊Έ ʹ͓ͯ͘͠ ؅ཧը໘ μογϡϘʔυ Ͱ ௥Ճͨ͠ػೳΛ࢖͑ΔΑ͏ʹ͢Δ
  17. & ·ͱΊ 4USJQF$IFDLPVUͷ࣮૷ʹ͍ͭͯͷ εςʔλε TUBOECZ TBMF QBVTF FOE TPMEPVU ελϯόΠ

    ൃചத ൃചٳࢭ ൃചऴྃ ചΓ੾Ε νέοτ໊ νέοτ໊ TJOHMF NVMUJQMF ຕߪೖ ෳ਺ߪೖ UJDLFU@TUBUVT UJDLFU@TUSJQF@JE UJDLFU@UZQF ։࠵೔ UJDLFU@EBZ ։৔࣌ؒ UJDLFU@PQFO ։ԋ࣌ؒ UJDLFU@TUBSU લചνέοτֹۚ UJDLFU@BEWBODF@TBMF ౰೔νέοτֹۚ UJDLFU@UIBUEBZ XQ@FORVFVF@TDSJQU KRVFSZVJDPSF  XQ@FORVFVF@TDSJQU KRVFSZVJEBUFQJDLFS  XQ@FORVFVF@TUZMF KRVFSZVJDTT BKBYHPPHMFBQJTDPNBKBYMJCTKRVFSZVJUIFNFTTNPPUIOFTTKRVFSZVJDTT  XQ@FORVFVF@TDSJQU KRVFSZVJKTKB BKBYHPPHMFBQJTDPNBKBYMJCTKRVFSZVJJOKRVFSZVJEBUFQJDLFSKBNJOKT  ։࠵೔͸K2VFSZ6*%BUFQJDLFS
  18. & ·ͱΊ 4USJQF$IFDLPVUͷ࣮૷ʹ͍ͭͯͷ QPTU@TUBUVT͕QVCMJTIɺQPTU@UZQF͕DSXTKQ@TUSJQF@JUFNͷσʔλΛऔಘ͠·͢ $query_ITEM = <<<SQL SELECT * FROM

    {$wpdb->posts} WHERE post_status = 'publish' AND post_type = 'crwsjp_stripe_item' SQL; $results_ITEM = $wpdb->get_results($query_ITEM); get_results ʹ͍ͭͯɹhttps://wpdocs.osdn.jp/ؔ਺ϦϑΝϨϯε/wpdb_Classࢀর $4+1ϓϥάΠϯͰอଘ͍ͯ͠ΔσʔλΛऔಘ͢Δ $4+1ϓϥάΠϯͰ͸ΧελϜ౤ߘλΠϓΛར༻ͯ͠σʔλΛอଘ͍ͯ͠·͢ɻ ֤छઃఆ৘ใ͸XQ@PQUJPOTʹอଘ͍ͯ͠·͢ɻ ͜ΕΒͷσʔλΛ͏·͘ར༻͢Ε͹ɺػೳΛͲΜͲΜ֦ு͢Δ͜ͱ͕Ͱ͖·͢ɻ
  19. & ·ͱΊ 4USJQF$IFDLPVUͷ࣮૷ʹ͍ͭͯͷ foreach($results_ITEM as $for_id){ $postid = $for_id ->

    ID; $valueid = $for_id -> ID; if(!isset($results_ITEM_id)){ $results_ITEM_id = array( $postid => $valueid ); }else{ $results_ITEM_id += array( $postid => $valueid ); } }
  20. & ·ͱΊ 4USJQF$IFDLPVUͷ࣮૷ʹ͍ͭͯͷ foreach($results_ITEM as $for_title){ $post_title = $for_title ->

    ID; $value_title = $for_title -> post_title; if(!isset($results_ITEM_title)){ $results_ITEM_title = array( $post_title => $value_title ); }else{ $results_ITEM_title += array( $post_title => $value_title ); } }