现在使用 Paypal,我们不需要很多自定义字段,只有一个标准的 IPN 接收文件,这意味着我们必须将即时付款通知分开发送到申请网站。
现在我想用自定义字段来做到这一点。 基本上,我发布了一个带有网站名称和 customer_id_number 的自定义值,例如:'website1 12345'。 现在移出网站名称很容易,因为我可以为此制作多个“if's”和“and if's”:
if ($custom == 'website1%') {}
但现在我当然想移出 customer_id_number,在这个例子中是 12345。 通过示例输入如下内容:
$customer_id_number = somewaytoshiftthenumberout;
有没有特殊的技巧可以做到这一点,所以你们能告诉我正确的方向吗?
提前致谢!
最佳答案
我建议你使用explode
。
例如写 website1||12345,并使用:
$custom_exploded = explode('||', $custom);
if ($custom_exploded[0] == 'website1')
// insert in DB $custom_exploded[1]
关于php - Paypal 自定义字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17417810/