我有这个伪代码,我一直在试图创建正确的PHP语法,并且我得到了绝对的无处不在。我继续在函数group_job_items上得到一个Parse错误。PHP解析语句错误if语句
Parse error: syntax error, unexpected '{' on line 17
这里有什么问题?任何帮助将不胜感激。
function group_job_items()
{
$jobs_by_category = array();
foreach ($category_name as $category_id => $name)
{
foreach ($job_item as $item)
{
// skip job items that do not match the current category
if ($item["category_id"] != $category_id) continue;
if (!isset ($jobs_by_category[$name])
{
// create a list of jobs for the current category
$jobs_by_category[$name] = array();
}
// add the current job item to the current category
$jobs_by_category[$name][] = $item
}
}
}
计算开合圆括号;你错过了最后一个。 – Gumbo