<?php

function findCoincidences($textOfArray) {
    $output = "";

    // Locate all the duplicated Strings (keys and values)
    preg_match_all('/".*?"/', $textOfArray, $matches);

    // Make array where key = string, and value = repetitions
    $arrayCoinc = array_count_values($matches[0]);

    $output = "==== COINCIDENCES  ====<br>";
    foreach ($arrayCoinc as $k => $v){
        if ($v > 1){
            $output .= "<b>".$k."</b> Found:".$v."<br>";
        }
    }
    return $output;
}

$array1 = '$array = ["hello"=>1, "hello"=>2,];';

echo findCoincidences($array1);

// your code goes here