(int)$match[1], 'end' => (int)$match[2]]; } for ($i = 0; $i < count($dates); $i++) { for ($j = $i + 1; $j < count($dates); $j++) { if ($dates[$i]['start'] < $dates[$j]['end'] && $dates[$j]['start'] < $dates[$i]['end']) { $flags[] = 'Potential overlapping dates found.'; break 2; } } } return $flags; } function get_role_based_suggestions($resume, $role) { $role_keywords = [ 'software engineer' => ['php', 'javascript', 'python', 'java', 'c++', 'sql', 'html', 'css', 'react', 'angular', 'vue', 'node.js', 'aws', 'azure', 'gcp', 'docker', 'kubernetes', 'git'], 'product manager' => ['agile', 'scrum', 'roadmap', 'user stories', 'market research', 'competitive analysis', 'product launch', 'kpis', 'user feedback', 'a/b testing'], 'data scientist' => ['python', 'r', 'sql', 'machine learning', 'deep learning', 'tensorflow', 'pytorch', 'scikit-learn', 'pandas', 'numpy', 'data visualization', 'statistics'] ]; $suggestions = []; if (isset($role_keywords[$role])) { $resume_words = str_word_count(strtolower($resume), 1); $missing_keywords = array_diff($role_keywords[$role], $resume_words); if (!empty($missing_keywords)) { $suggestions['add'] = $missing_keywords; } } else { $suggestions['error'] = 'Role not found. Please try one of the following: Software Engineer, Product Manager, Data Scientist.'; } return $suggestions; }