我有一个多个电子邮件输入字段,当我提交此表单时,我正在序列化数据并进行Ajax调用。当我在我的treatment.php时,我可以通过访问$_POST['emailAddress']访问我的电子邮件列表,从而显示我的电子邮件地址。现在,我需要使用Foreach对这些电子邮件进行一些操作,但我不能使用该字符串的预测。我该怎么做?Thx
我的前辈:
foreach ($adresses as $adresse){
//actions to do;
}
根据通过查找,我使用了GROUP_CONCAT
SELECT
`topic_response`.`response`,
GROUP_CONCAT(`comment` SEPARATOR 0x1D ) AS `comment`,
`topic_response`.`add_date`
FROM `topic_response`
WHERE (topic_id = 286)
AND (`comment` IS NOT NULL)
GROUP BY `response`
ORDER BY `add_date` desc
然后我的输出被正确地分开,但我不知道如何explode()它
这是我的阵列:
array:4 [
0 => "Family Deluxe for 4 Person x 1"
1 => "Studio Deluxe for 2 Person x 1"
2 => "Additional Adult x 2"
3 => "Additional Children x 2"
]
当我传入一个foreach循环以删除x并获取计数时,我会遇到以下输出结果:
array:4 [
0 => array:1 [
"Family Delu"
我正在尝试从PHP中的字符串中提取一个子字符串。提取的子字符串应该以一个单词结尾。我尝试使用以下代码,但没有得到任何输出。
if (strlen($userresult->aboutme) > 20) // value of $userresult->aboutme is 'Very cool and friendly'
{
$description=substr($userresult->aboutme, 0, strpos($userresult->aboutme, ' ', 20));
}
else
{