'Fire', 'Leo' => 'Fire', 'Sagittarius' => 'Fire',
'Taurus' => 'Earth', 'Virgo' => 'Earth', 'Capricorn' => 'Earth',
'Gemini' => 'Air', 'Libra' => 'Air', 'Aquarius' => 'Air',
'Cancer' => 'Water', 'Scorpio' => 'Water', 'Pisces' => 'Water'
];
return $elements[$sign] ?? 'Unknown';
}
$elem1 = getElement($sign1);
$elem2 = getElement($sign2);
// Calculate Base Score based on Elements
$score = 50; // Base score
$desc_key = "average";
if ($sign1 == $sign2) {
$score = 85; // Same sign is usually good but intense
$desc_key = "good";
} elseif ($elem1 == $elem2) {
$score = 95; // Same element is excellent
$desc_key = "excellent";
} elseif (
($elem1 == 'Fire' && $elem2 == 'Air') || ($elem1 == 'Air' && $elem2 == 'Fire') ||
($elem1 == 'Earth' && $elem2 == 'Water') || ($elem1 == 'Water' && $elem2 == 'Earth')
) {
$score = 88; // Complementary elements
$desc_key = "very_good";
} else {
$score = 65; // Challenging matches
$desc_key = "challenging";
}
// Add a little randomization based on names so it doesn't look static,
// but is consistent for the same pair (hashing)
$hash = crc32($sign1 . $sign2);
$variation = ($hash % 10) - 5; // -5 to +5 variation
$finalScore = min(100, max(40, $score + $variation));
// Determine CSS Class and Label
$cssClass = "average";
$statusLabel = "Average Match";
if ($finalScore >= 90) {
$cssClass = "excellent";
$statusLabel = "Excellent Match";
} elseif ($finalScore >= 80) {
$cssClass = "good";
$statusLabel = "Very Good Match";
} elseif ($finalScore >= 60) {
$cssClass = "average";
$statusLabel = "Average Match";
} else {
$cssClass = "challenging";
$statusLabel = "Challenging Match";
}
// Generate Dynamic Description
$desc = "";
if ($cssClass == "excellent") {
$desc = "The marriage compatibility between $sign1 and $sign2 is highly auspicious. Your elemental energies ($elem1 and $elem2) harmonize perfectly, creating a foundation of mutual understanding and deep emotional connection.";
} elseif ($cssClass == "good") {
$desc = "This union shows great promise. While $sign1 brings unique strengths, $sign2 complements them well. Marriage will be stable, though occassional compromise is needed regarding your different approaches to life.";
} elseif ($cssClass == "average") {
$desc = "A relationship between $sign1 and $sign2 requires effort but can be rewarding. The $elem1 and $elem2 combination creates some friction, which can lead to passion but also misunderstandings. Communication is your key to success.";
} else {
$desc = "This marriage match faces astrological challenges due to conflicting elemental natures ($elem1 vs $elem2). However, with patience and conscious effort to understand your differences, this bond can evolve into a strong partnership.";
}
// --- COMPATIBILITY LOGIC END ---
?>
Marriage Compatibility Result
Verdict:
Detailed Marriage Analysis
- Emotional Connection: % - How well you understand each other's feelings.
- Communication: % - The ease of resolving conflicts.
- Trust & Dependability: % - The strength of your marital foundation.