如何从PHP中的URL获取POST参数

时间:2018-07-25 12:18:27

标签: php post woocommerce get request

我有此POST请求: http://localhost/wordpress/muj-ucet/?OPERATION=CREATE_ORDER&ORDERNUMBER=2725&MERORDERNUM=84&PRCODE=0&SRCODE=0&RESULTTEXT=OK&DIGEST=K%2BfIxT6L2oww32%2FmkofsewQV7y%2B%2FpPySi5XTabu%2FQVGAWi01hnuYRmvXfNvzn2ykroExAL61YvwxpVTQXaicfzuDPpr0mcuELMRzG2pH4dbnFFUnZ9ztnMrnFXtGmf48rc4i3r1O3A2MrDoRCMZ7OqpQt2zAgPGZSVTto%2FoNYlJRuOkhZzTwi%2BOC9RWVLGSUN81t%2FVAgUnrwQDEKKIfgPomC5BsSQlHYfBATvVltD3L0DO1eVeUNxcvh9xBHJ%2BxZZT%2Bbd8z3%2BtJwn6vnS2r5u%2BNunUsGFYJZpK7BbjSjCTsxO2SKib%2B%2FoKWLmU7yaZWYawcAGQzu0jbpcVd0SrxUcw%3D%3D&DIGEST1=EnmOfGWjP5ly3OacV0sUhS6l59oLVDLwprpEb5Pg%2FporFM3fgjMzCHaZF1hKq3SUQ7%2BZO2UmyjQnSQ8%2Bk9dtQaSduunpja7wtDlOx%2BItFtFxF7rWyYpE6X%2FQkTIxoLRs7KjcIBRB2U34do9xrFyoNQvUWuxDMAaZ2yuu80SYxnx5qPY80wlDWlS2MFyEXvhO%2BCuz2v8NorPKcm7xLvLt%2F0PPYgB%2FeFuLMsDIGPGo6TMJtdU0NRSF4dkQAKouchILiUZvhyN80ou2%2B3bSWnPNfmcK5gWZQoGKl1qENMe87zsTa71TdxZR4AnlEzxWXhYwVFRh%2B8LueKNNM6%2FRtXVhLQ%3D%3D 我想从URL中获取这些参数,并将其放入以下代码中:

residL=['M', 'P', 'P', 'M', 'L', 'S', 'G', 'L', 'L', 'A', 'R', 'L', 'V', 'K', 'L', 'L', 'L', 'G', 'R', 'H', 'G', 'S', 'A', 'L', 'H', 'W', 'R', 'A', 'A', 'G', 'A', 'A', 'T', 'V', 'L', 'L', 'V', 'I', 'V', 'L', 'L', 'A', 'G', 'S', 'Y', 'L', 'A', 'V', 'L', 'A']
residL[9::10] = [x+'\n%i'%((i+1)*10) for i, x in enumerate(residL[9::10])] 
residL
# => ['M', 'P', 'P', 'M', 'L', 'S', 'G', 'L', 'L', 'A\n10', 'R', 'L', 'V', 'K', 'L', 'L', 'L', 'G', 'R', 'H\n20', 'G', 'S', 'A', 'L', 'H', 'W', 'R', 'A', 'A', 'G\n30', 'A', 'A', 'T', 'V', 'L', 'L', 'V', 'I', 'V', 'L\n40', 'L', 'A', 'G', 'S', 'Y', 'L', 'A', 'V', 'L', 'A\n50']

0 个答案:

没有答案