【发布时间】:2020-11-20 21:51:51
【问题描述】:
我需要帮助解决以下错误
Notice: Array to string conversion in /www/test_123/public/wp-content/plugins/test-functions/match-functions.php on line 302
下面是写在 301 和 302 行的,不知道哪里错了。当我将联系表 7 更新到最新版本时会发生这种情况,但在 5.1.6 上没有这样的错误。
$location = WC_Geolocation::geolocate_ip();
$p1_dob = $your_birth_year . "-" . $your_birth_month . "-" . $your_birth_day;
$p2_dob = $partners_birth_year . "-" . $partners_birth_month . "-" . $partners_birth_day;
$pmf_love_match_html_url = "https://primary.astrowebserver.net/v2/reports/CreateShortHTML/REL-NEW-DUALMATCH/?APIKEY=012bc72f-093a-4617-9432-0cbb55662ad7&P1FirstName=" . $your_first_name . "&P1DOB=" . $p1_dob . "&P1Sex=" . $your_gender . "&P1Country=" . $location['country'] . "&P2FirstName=" . $partners_first_name . "&P2DOB=" . $p2_dob . "&P2Sex=" . $partners_gender . "&P2Country=" . $location['country'];
【问题讨论】:
-
严格来说这不是一个错误,而是一个通知。使用 implode() 函数将数组正确转换为字符串或以其他方式识别数组元素。
-
如果这些字段
$your_birth_year等来自联系表格 7。您如何获取这些字段的值,它们中的任何一个是选择(下拉)还是复选框?
标签: php wordpress contact-form-7